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

Conditional Map?

by George_Sherston (Vicar)
on Oct 07, 2002 at 11:26 UTC ( [id://203288]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array = qw/
        foo
        bar
        baz
        bodkin
    /;
    
  2. or download this
    my %hash2 = ();
    foreach $_ (@array) {
        $hash2{getkey($_)} = $_ unless /^f/;
    }
    
  3. or download this
    my %hash1 = map {getkey($_) => $_ unless /^f/} @array;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found