Think about Loose Coupling | |
PerlMonks |
(lexical $_) Re: $_ haters anonymouby dchetlin (Friar) |
on Dec 11, 2000 at 16:17 UTC ( [id://46067]=note: print w/replies, xml ) | Need Help?? |
Enh, but then it's impossible to define subroutines that work
like built-ins such as chomp.
I do that not infrequently. However, I wouldn't mind having to go through hoops to get there. Perhaps a subroutine attribute would have to be set to allow you access to $_.
That way, no one could clobber $_ without intending to. And we could also add a pragma to disallow code outside of your file (or perhaps package) from clobbering $_ even if it wanted to. -dlc
In Section
Seekers of Perl Wisdom
|
|