This code prints "param". I guess I'm confused as to how instances of packages are created. I assumed that the two calls to subs one and two in the main code above were separate and that the variable image would not retain its value between the two calls.Package Pack; my $image; sub one { ($image)=@_; } sub two { print $image; } ##main code use Pack; Pack::one("param"); my $ret=Pack::two(); print $ret;
In reply to Instance Module by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |