Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    
    #Output
    # T2
    
  2. or download this
    my $foo = 1;
     
    # post decrement (printed and then decremented to 0)
    print $foo--; # prints 1
    print $foo;   # prints 0
    
  3. or download this
    my $foo = 1;
     
    # pre-decrement (decremented to 0 then printed)
    print --$foo;  # prints 0
    print $foo;    # prints 0