use strict;
use warnings;
package Foo;
local $bar;
sub init {
$bar = 42;
}
1;
####
Global symbol "$bar" requires explicit package name at Foo.pm line 6.
Global symbol "$bar" requires explicit package name at Foo.pm line 9.
Global symbol "$bar" requires explicit package name at Foo.pm line 10.
Foo.pm had compilation errors.
##
##
use strict;
use warnings;
package Foo;
my $bar;
sub init {
$bar = 42;
print $bar;
}
1;
##
##
use strict;
use warnings;
use Foo;
Foo::init();
print $Foo::bar;
##
##
Name "Foo::bar" used only once: possible typo at math1.pl line 7.
Use of uninitialized value in print at math1.pl line 7.