We don't bite newbies here... much | |
PerlMonks |
Re: Use cases for 'sub Pckg::func { }' ?by ikegami (Patriarch) |
on Jul 31, 2020 at 14:00 UTC ( [id://11120142]=note: print w/replies, xml ) | Need Help?? |
The pattern you are observing is that the package directive controls the package in which code is compiled. sub X::foo { pp(\@_) } is simply not an exception to that. Effort to provide a special behaviour for sub X::foo { pp(\@_) } was not spent. Put differently, is short for which is effectively what happens every time you import a symbol from a module (e.g. use X qw( foo );).
In Section
Seekers of Perl Wisdom
|
|