Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: how to split hash into two arrays

by Your Mother (Archbishop)
on Jul 07, 2009 at 08:00 UTC ( [id://777785]=note: print w/replies, xml ) Need Help??


in reply to how to split hash into two arrays

Possibly (sorry, not one liner)-

use YAML; my ( @one, @two ); my %one_two = map {; $_ => int(rand(2) } 1 .. 10; for my $key ( keys %one_two ) { push @one, $key; push @two, $one_two{$key} || undef; # "skips" 0s here. } print Dump ( \%one_two, \@one, \@two );

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-19 05:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found