Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Conditional Map?

by broquaint (Abbot)
on Oct 07, 2002 at 11:33 UTC ( [id://203289]=note: print w/replies, xml ) Need Help??


in reply to Conditional Map?

This sort of situation suits for just fine and doesn't really fit with a sole map as it's really designed towards applying a transform to a list, not iterating over one. You could however achieve your goal using map and grep in conjunction e.g
my %hash1 = map { getkey($_) => $_ } grep { !/^f/ } @array;

HTH

_________
broquaint

Log In?
Username:
Password:

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

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

    No recent polls found