Help for this page

Select Code to Download


  1. or download this
    use strict;
    use vars '$x';
    ...
      my $y = 300;
      frobnicate( $w, $x, $y ); # that's the global $x in there!
    }
    
  2. or download this
    use strict;
    $MyModule::x = 3;
    ...
      my $y = 300;
      frobnicate( $w, $x, $y ); # won't compile
    }
    
  3. or download this
    sub that_uses_global_x_heavily {
      our $x;                   # we drop the formalities locally
    ...
      and_one_more_thing( $x );
      # ...
    }