I beleive you can just declare $fix in the scope of the FOO package instead of the sub. The following appears to do what you want.
use strict; use warnings; { package FOO; my $fic; sub Principal::bof { $fic = "toto"; bof2(); } sub bof2 { print $fic; } } Principal::bof();
In reply to Re: accessing $var problem due to package and subs
by eric256
in thread accessing $var problem due to package and subs
by secret
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |