Re: sharing amongst subroutines

2006-02-20 Thread Jeff Pang
>I can do this using "our" in place of "my" - after perl 5.6. hello,even you use 'my' instead of 'our',there is not any problem. where in some a subroutine, you use lexical var which is defined outside of this subroutine,you have made a closure.this var in subroutine is a private copy of lexic

Re: sharing amongst subroutines

2006-02-20 Thread The Ghost
I can do this using "our" in place of "my" - after perl 5.6. how do I: { package ThePackage; use strict; my $dbh=$HTML::Mason::Commands::dbh; sub printdbh { print "$dbh\n"; } sub otherSub { print ref $dbh, "\n"; }

sharing amongst subroutines

2006-02-20 Thread The Ghost
how do I: { package ThePackage; use strict; my $dbh=$HTML::Mason::Commands::dbh; sub printdbh { print "$dbh\n"; } sub otherSub { print ref $dbh, "\n"; } sub anotherSub { dosomething($dbh);} } Thanks again