Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Using s///e and it just doesn't feel right

by kral (Monk)
on Jun 23, 2003 at 08:44 UTC ( [id://268076]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Using s///e and it just doesn't feel right
in thread Using s///e and it just doesn't feel right

These are functionally the same, but map generates a return value that can be assigned to another array, and foreach does not, therefore map is not appropriate.
There are also situations where forech aren't appropriate. Like:

foreach(@array){ push(@tmp, $_) if(/$regex/); }
But I respect this way of coding 'cause TMOWTDI.
----------
kral
(sorry for my english)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-19 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found