www.perl.com
Perl Programming
Modifiers
  • Simple statements can take single modifiers
    • Places emphasis on the statement, not the control
    • Can make programs more legible
    • Parentheses usually not needed
    • Good for setting default values
    • Valid modifiers are if, unless, while, until, foreach

        $a = $default unless defined $a;
        $b = $default unless defined $b;
        $c = $default unless defined $c;

        $balance += $deposit
           if $deposit;
        $balance -= $withdrawal
           if $withdrawal and $withdrawal <= $balance;
      
http://stuff.mit.edu/iap/perl/