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

Re: Merging arrays

by smls (Friar)
on Jun 27, 2013 at 19:57 UTC ( #1041086=note: print w/ replies, xml ) Need Help??


in reply to Merging arrays

The mesh function from the List::MoreUtils module can be used to create a hash out of two arrays, with the n'th values from the two arrays forming the n'th key/value pair in the hash:

use List::MoreUtils qw(mesh); my @array = qw( 111 222 333 444 555 888 ); my @array2 = qw( acct1 acct2 acct3 acct4 acct5 acct8 ); my %merged = mesh @array, @array2;


Comment on Re: Merging arrays
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-08-22 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (156 votes), past polls