in reply to accessing $var problem due to package and subs
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();
|
|---|