Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^7: (Mis)Understanding "works"

by tye (Sage)
on Feb 25, 2009 at 18:27 UTC ( #746336=note: print w/replies, xml ) Need Help??

in reply to Re^6: (Mis)Understanding "works"
in thread (Mis)Understanding grep...eq $_

Frankly, that is more bizarre. You jumped from "grep works on lists and arrays" to "grep works on lists in the normal way and does something completely different to arrays"?

But if your worry was that someone rather magically thought that grep on an array removes things from the array, then why did you demonstrate a lack of optimization rather than demonstrating that grep doesn't modify the array?

In any case, I don't think your point was well understood (which doesn't surprise me). I think you would have been more helpful had you responded differently to the slightly redundant but not incorrect inclusion of "and arrays" which likely shows a leak of or bow to the common false dichotomy between "list" and "array" in Perl. Rather than elevate this false dichotomy to the point of "works on arrays" means "does something /different/ with arrays", you should have just noted that "grep works on lists. an array can be used as a list". That is, push back against the false dichotomy.

grep works on lists. So, of course, it also works on arrays (which are a type of list).

Bizarre consequences of optimizations of foreach seem particularly unenlightening to, more distracting from that point.

- tye        

Replies are listed 'Best First'.
Re^8: (Mis)Understanding "works"
by ysth (Canon) on Mar 01, 2009 at 06:28 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-08-12 14:10 GMT
Find Nodes?
    Voting Booth?

    No recent polls found