www.perl.com
Perl Programming
Numeric Operators
  • Numeric operators provide numeric context
  • All common operators are provided
    • Increment and decrement (++, --)
    • Arithmetic (+, *)
    • Assignment (+=, *=)
    • Bitwise (<<, >>)

        my $i = 17;
        $i = ($i + 3) * 2;  # Parentheses for order of operation
        $i++;               # $i = $i + 1;
        $i *= 3;            # $i = $i * 3;
        print "$i\n";
      

        123
      
Previous http://stuff.mit.edu/iap/perl/