syntactic has asked for the wisdom of the Perl Monks concerning the following question:
I expected to get "zbc", but no, it's "abc". Where do I go wrong?@l = ( "a", "b", "c" ); @m = grep /a/, @l; $m[0] = "z"; print @l;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: modify list through grep
by Sidhekin (Priest) on Nov 26, 2006 at 15:30 UTC | |
Re: modify list through grep
by mickeyn (Priest) on Nov 26, 2006 at 16:01 UTC | |
Re: modify list through grep
by calin (Deacon) on Nov 26, 2006 at 16:07 UTC | |
by jdporter (Paladin) on Nov 26, 2006 at 16:30 UTC | |
by calin (Deacon) on Nov 26, 2006 at 16:46 UTC | |
by syntactic (Initiate) on Nov 26, 2006 at 21:30 UTC | |
by tye (Sage) on Nov 27, 2006 at 06:19 UTC | |
Re: modify list through grep
by parv (Parson) on Nov 26, 2006 at 23:26 UTC | |
Re: modify list through grep
by GrandFather (Saint) on Nov 26, 2006 at 21:44 UTC |