P is for Practical | |
PerlMonks |
Re: non-global $/by hanenkamp (Pilgrim) |
on Jun 22, 2005 at 13:44 UTC ( [id://469013]=note: print w/replies, xml ) | Need Help?? |
I'm not certain why you need this, but here's the deal. The $/ is a global variable. Adding the local before setting $/ to "Foo" makes it local to that block and anything you call from that block. The only way I know of to make a global "package specific" is to locally reset it to your desired package version at the start of every method (again using the local keyword. Personally, I tend to just avoid the globals whenever I can.
In Section
Seekers of Perl Wisdom
|
|