- or download this
# Foo.pm
...
print 'from package ', __PACKAGE__, " during use: '$hello' \n";
1;
- or download this
# use_foo_1.pl
...
hello('test');
print 'from package ', __PACKAGE__, " during execution: '", get_hello,
+ "' \n";
- or download this
c:\@Work\Perl\monks\Anonymous Monk\1207065>perl use_foo_1.pl
from package Foo during use: 'evaluated during module inclusion'
from package main during execution: 'evaluated during module inclusion
+'
- or download this
# Foo.pm
...
print 'from package ', __PACKAGE__, " during use: '$hello' \n";
1;
- or download this
# use_foo_2.pl
...
printf "B: from package %s during execution: '%s' \n",
__PACKAGE__, get_hello;
- or download this
c:\@Work\Perl\monks\Anonymous Monk\1207065>perl use_foo_2.pl
from package Foo during use: 'evaluated during module inclusion'
A: from package main during execution: 'evaluated during module inclus
+ion'
B: from package main during execution: 'now we're getting somewhere!'