in reply to Thoughts on the magicality of @_ and $_
Is the same true if you use an intermediate variable - does it get aliased, or merely assigned?It's weirder than that. Check this out:
I'm using the lvalueness of the grep, foreach, substr, and argument passing there. With a little more work, you can add the lvalueness of slices and values as well. {grin}my $one = "wired"; for my $two (grep 1, substr($one, 1, 3)) { sub { $_[0] = "eir" } -> ($two); } print $one;
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
(MeowChow) Re2: Thoughts on the magicality of @_ and $_
by MeowChow (Vicar) on Jun 28, 2002 at 21:22 UTC |