Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Search Hash with array element Help!

by jrsimmon (Hermit)
on Mar 04, 2010 at 20:26 UTC ( [id://826802]=note: print w/replies, xml ) Need Help??


in reply to Search Hash with array element Help!

my @array_code= qw(WE4321 PP7654 8973 7865 TT3422); my %code_numbers = ( "4321" =>"XX", "7654" => "BB", "8973" => "" ); foreach my $value (@array_code){ my $nums = $value; $nums =~ s/\D//g; if(exists($code_numbers{$nums})){ if($code_numbers{$nums} eq ''){ print "$value\tIN\n"; }else{ print "$value\t$code_numbers{$nums}\n"; } } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2025-02-12 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found