in reply to Re^3: modify list through grep
in thread modify list through grep
For the modification part I can use grep again and modify the value through $_, but then I call expensive grep twice. If I could save a reference (alias?) into @values in the if condition statement I can have a lighter code.foreach $p ( @patterns ) { if ( ??? grep /$p/, @values ) { modify the matching list value; } else { push @values, "strings $pattern"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: modify list through grep (slice)
by tye (Sage) on Nov 27, 2006 at 06:19 UTC |