secret has asked for the wisdom of the Perl Monks concerning the following question:
Hello esteemed Monks,
I have the following pm file :
Which is loaded by a script like this :use strict ; use warnings ; package FOO ; sub Principal::bof { my $fic = "toto" ; bof2() ; } sub bof2 { print $fic } 1;
This fails with Global symbol "$fic" requires explicit package name .use strict ; use warnings ; package Principal ; require ("ot.pm") ; Principal::bof() ;
I tried to do print $FOO:fic or print $Principal::fic in the bof2 sub but then it fails with Use of uninitialized value in print
I don't understand the namespaces relations in this . Is there a way i can access the value from bof2() without passing it as parameter ?
Thanks if you can help .
Back to
Seekers of Perl Wisdom