P is for Practical | |
PerlMonks |
Re: modify list through grepby Sidhekin (Priest) |
on Nov 26, 2006 at 15:30 UTC ( [id://586112]=note: print w/replies, xml ) | Need Help?? |
grep returns aliases, but assignment (to @m) makes copies. You can not modify the grep results directly though, so you need to do something like take a reference, pass it to a (naughty) sub, or make a modifiable alias in order to modify the alias, and not just a copy thereof:
Prints "zbc".
print "Just another Perl ${\(trickster and hacker)},"
In Section
Seekers of Perl Wisdom
|
|