#!perl
use strict;
use warnings;
my $test = 1.23;
print "test: $test \n";
print My::Test::Print::printer() ."\n";
package My::Test;
our $VERSION = 1.11;
package My::Test::Print;
sub printer {
print "This is ". $My::Test::VERSION ."\n";
}
####
test: 1.23
Use of uninitialized value $My::Test::VERSION in concatenation (.) or string at
x.pl line 17.
This is
1
##
##
my $test = 1.23;
##
##
SYMBOL TABLE:
$test = 1.23
##
##
print "test: $test \n";
##
##
print My::Test::Print::printer() ."\n";
##
##
print "This is ". $My::Test::VERSION ."\n";
##
##
# mytest.pl:
#!perl
use strict;
use warnings;
use MyTest;
My::Test::Print::printer();
package My::Test::Print;
sub printer {
print "This is ". $MyTest::VERSION ."\n";
}
##
##
# MyTest.pm:
package MyTest;
our $VERSION = 1.11;
##
##
$ perl mytest.pl
This is 1.11
##
##
#!perl
use strict;
use warnings;
use MyTest;
my $test = 1.23;
print "test: $test \n";
print My::Test::Print::printer() ."\n";
package My::Test;
BEGIN {
our $VERSION = 1.11;
}
package My::Test::Print;
sub printer {
print "This is ". $My::Test::VERSION ."\n";
}
##
##
$ perl mytest.pl
This is 1.11