Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Multiple Hash values

by boftx (Deacon)
on Mar 06, 2015 at 21:26 UTC ( [id://1119115]=note: print w/replies, xml ) Need Help??


in reply to Multiple Hash values

The short answer is: yes

use strict; use warnings; my %Hash = ( a => [ qw( i ii iii ) ], b => [ qw( iv v vi ) ], ); # one way to do it for my $var ( sort keys %Hash ) { my $array_ref = $Hash{$var}; for my $element ( @{$array_ref} ) { print "$element,"; } } exit;

The foregoing (untested) code is pretty basic, but I often reach for simple things if I want to make what I'm doing crystal clear to others and even myself months down the road.

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-24 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found