Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: hash pointing to AoA

by NetWallah (Canon)
on May 19, 2008 at 16:35 UTC ( [id://687413]=note: print w/replies, xml ) Need Help??


in reply to Re: hash pointing to AoA
in thread hash pointing to AoA

Here is a somewhat more idiomatic implementation of your code:
use strict; my %hash; my $key='NetWallah'; $hash{$key} = [ map{ [ map {int(rand()+0.5)} 0..9 ] } 0..9 ]; printit(\%hash); sub printit{ my $href=shift; for my $key(sort keys %$href){ my $row = 0; print "{$key} =>\n"; for my $rowref (@{$href->{$key}}) { print " $row\t"; for my $val (@$rowref) { print "$val "; } $row++; print "\n"; } } }

     "How many times do I have to tell you again and again .. not to be repetitive?"

Log In?
Username:
Password:

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

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

    No recent polls found