Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Array to hash converstion

by spazm (Monk)
on Jul 15, 2009 at 06:23 UTC ( #780174=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %final_hash;
    foreach my $data_pair ( @data_list)
    ...
    
    use Data::Dumper;
    print Dumper \%final_hash;
    
  2. or download this
    my %final_hash = 
      map { $_->{key} => $_->{value} } 
    ...
    #verify the output
    use Data::Dumper;
    print Dumper \%final_hash;
    
  3. or download this
    #!/usr/bin/perl -w
    
    ...
    
    is_deeply( \%final_hash_long,  $expected, "long version works" );
    is_deeply( \%final_hash_short, $expected, "short version works" );
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2020-07-08 14:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?