You don't need to put the sub in the other package in order to access that package's variables. Just refer to them explicitly, as you do in the assignment.
$var = 'one'; $mypackage::var = 'two'; sub we_got_the_func { print "Other \$var is $mypackage::var\n"; } we_got_the_func(); __END__ Other $var is 'two'
In reply to Re: problem ..related to perl package concept
by kyle
in thread problem ..related to perl package concept
by perlplayer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |