Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: "foreach" is to "next" as "map" is to ???

by Enlil (Parson)
on May 26, 2004 at 16:28 UTC ( [id://356634]=note: print w/replies, xml ) Need Help??


in reply to "foreach" is to "next" as "map" is to ???

grep is a good way to do it another way would be:
@modified_list = map { $_ =~ /good stuff/ : #do stuff here ? () } @array;
or the map grep combo:
@modified_list = map { #do stuff here } grep { /good_stuff/ } @array
-enlil

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (11)
As of 2024-03-28 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found