Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^4: RFC: List::Extract

by mreece (Friar)
on Nov 25, 2007 at 03:52 UTC ( #652787=note: print w/replies, xml ) Need Help??

in reply to Re^3: RFC: List::Extract
in thread RFC: List::Extract

i agree, especially since grep has the same 'unimplied' aliasing of $_.

Replies are listed 'Best First'.
Re^5: RFC: List::Extract
by doom (Deacon) on Nov 25, 2007 at 22:13 UTC

    i agree, especially since grep has the same 'unimplied' aliasing of $_.

    Right, that's what I meant about discarding changes being reasonable, but possibly in an "unperl-like way"

    Remember that with grep changes made to $_ propagate in both directions, effecting the source as well as the returned values: "Note that $_ is an alias to the list value, so it can be used to modify the elements of the LIST."

    That side-effect of changing the source values was probably a bad idea and getting rid of it in "extract" would be all to the good.

    It is a good point that it's hard to see why you would want to discard a modified $_ in the returned values -- if so, then why did you modify it?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://652787]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2023-03-22 19:54 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.