in reply to Re^2: modify list through grep
in thread modify list through grep
Yes, you're right. My reply was a bit tongue-in-cheek - the OP asked why his grep aliasing example "didn't work" and I resolved to beat it into submission ;)
There's a slight difference though. *m = \@l; aliases the entire array object. The sub {\@_} trick creates a new array object containing scalar elements which are aliased to memberes in @l matching /a/ (in OP's example it contains only one element aliased to the first element in @l - "a").
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: modify list through grep
by syntactic (Initiate) on Nov 26, 2006 at 21:30 UTC | |
by tye (Sage) on Nov 27, 2006 at 06:19 UTC |