10/17

5. Postfix Modifiers (Chapter 6)

  • Damian advocates limited use of postfix modifiers.

  • Good:

        next LOOP if m{some condition met}xms;
  • Bad:

        $n++,print $n for 1..10;
        print $n while ++$n < 10;
        $x = 1 if $x < 10;
  • Basically, only use postfix modifiers for flow control, specifically, with the keywords next, last, redo, return, goto, die, croak, or throw.