Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    ...
    # The lexical (second) one still wins.
    
    print $bar; # works, prints $foo::bar even though we are in baz
    
  2. or download this
    use strict;
    
    ...
    package baz;
    # $bar has only one meaning, access $baz::bar
    print $bar; #error
    
  3. or download this
    package foo;
    print $bar;   # prints the global $foo::bar
    
    package baz;
    print $bar;   # prints the global $baz::bar