Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by kyle (Abbot)
on Dec 19, 2007 at 17:19 UTC ( #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? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2023-05-28 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?