Help for this page

Select Code to Download


  1. or download this
    % perl -le 'use strict; $x = 1; print $x'
    Global symbol "$x" requires explicit package name at -e line 1.
    ...
    Execution of -e aborted due to compilation errors.
    % perl -le 'use strict; $main::x = 1; print $::x'
    1
    
  2. or download this
    use strict;
    
    ...
    }
    
    # ... code under strict
    
  3. or download this
    use strict;
    sub foobar { print "hello from foobar\n" }
    ...
    }
    __END__
    hello from foobar