in reply to Re^2: RFC: List::Extract
in thread RFC: List::Extract
Thanks for you feedback.
About keeping or discarding changes. Currently I'm leaning towards keeping changes in the returned list, but discarding changes for the other elements.
Here's an example that motivates keeping the changes for the returned list:
If changes are discarded you'd have to do ugly workarounds to not duplicate the logic. But if the changes are kept and you don't want them it's trivial to change the behaviour: just add local $_ = $_;.my @keywords = qw/ foo !bar baz /; my @exclude = extract { s/^!// } @keywords;
The reason I want to discard changes for elements left in the array is that if changes is kept for the returned array then changes are kept for all elements, and then you can usually just as well do those changes to the array before extract.
lodin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: RFC: List::Extract
by mreece (Friar) on Nov 25, 2007 at 03:52 UTC | |
by doom (Deacon) on Nov 25, 2007 at 22:13 UTC |