- or download this
use temp1;
temp1::init();
print "Calling work1: "; temp1::work1('$var');
print "\nCalling work2: "; temp1::work2('$var');
- or download this
package temp1;
my $var;
...
sub work1 { print eval $_[0]; }
sub work2 { print eval $_[0]; $var = $var; }
1;
- or download this
Calling work1:
Calling work2: 1