Bryan Harris wrote:
John W. Krahn wrote:
Bryan Harris wrote:
... but by modifying $_ I was clobbering $_ elsewhere in the larger program!
Yes because $_ is a special global variable. This effect is called
"action at a distance" which is why it is better to use named lexically
scoped variables instead of $_.
I have the Perl Bookshelf on CD (and perldoc, obviously) -- where can I read
more about this?
perldoc perlvar
http://shoebox.net/articles/perl-warts.html
http://en.wikipedia.org/wiki/Action_at_a_distance_(computer_science)
Oddly, perl won't let me do "my ($_) = shift;", so I'm stuck having to use
another variable.
Perl 5.10 *will* let you do "my $_".
Why is perl on OS X still at 5.8.8? It's free, right? why wouldn't Apple
include the latest one? (I know this isn't an Apple list, just wondering if
anyone knows.)
Perl 5.10 is still at the .0 stage (5.10.0) and a lot of people like to
wait until software has progressed past the .0 phase.
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/