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

Re: Conditional Map?

by seattlejohn (Deacon)
on Oct 07, 2002 at 14:04 UTC ( [id://203328]=note: print w/replies, xml ) Need Help??


in reply to Conditional Map?

map's best friend is grep, which returns the subset of list elements matching a condition. So you could start by selecting just the array elements you want: grep {substr($_,0,1) ne 'f'} @array

This returns a list consisting of qw(bar baz bodkin), which should be just what you need for your map: my %hash1 = map {getkey($_) => $_} grep {substr($_,0,1) ne 'f'} @array;

Log In?
Username:
Password:

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

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

    No recent polls found