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