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

Re: How to juggle between two arrays that are not same size

by kyle (Abbot)
on Dec 19, 2007 at 17:19 UTC ( [id://657920]=note: print w/replies, xml ) Need Help??


in reply to How to juggle between two arrays that are not same size

use Data::Dumper; @Names=qw(A B C); @FullRecord=qw(A_1 D_4 C_3 F_6 B_2); @name_presence{@Names} = (); @DesiredRecord = grep { exists $name_presence{(split /_/)[0]} } @FullRecord; print Dumper \@DesiredRecord; __END__ $VAR1 = [ 'A_1', 'C_3', 'B_2' ];

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-03-29 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found