#!/usr/bin/perl -w use strict; &foo1; sub foo1 { my $first=1; &foo2(\$first); print "$first\n"; } sub foo2 { my $second=shift; print "$$second\n"; $$second++; } #### #!/usr/bin/perl -w use strict; use warnings; &foo1; sub foo1 { local $b=1; &foo2; print "$b\n"; } sub foo2 { print "$b\n"; $b++; }