Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Listing Keys in a specific element(s) in an array of hashs

by mrborisguy (Hermit)
on Jun 20, 2005 at 13:15 UTC ( [id://468326]=note: print w/replies, xml ) Need Help??


in reply to Re: Listing Keys in a specific element(s) in an array of hashs
in thread Listing Keys in a specific element(s) in an array of hashs

Most monks would suggest the more natural foreach for something like this, as it tends to cut down on "one-off" errors. Also, it tends to be more intuitive (at least after you've learned Perl; I can see how your way would be more intutitive to a person coming from C or Java).

foreach my $href ( @data ) { for ( keys %$href ) { print "$_\n"; } }

    -Bryan

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (None)
    As of 2024-04-25 01:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found