http://qs1969.pair.com?node_id=212416


in reply to How to access info from the array

General answer : References quick reference.

More specific answer: $data{$formname} is an entry in a hash. The wrapping of the @{ ... } around it indicates that this hash entry is a reference to an array. What's being pushed onto the array is an anonymous hash (reference to a hash with no name).

Putting that together listily:

So, to iterate over the keys of that (anonymous) hash, you might do

foreach my $key ( keys %{ $data{$formname}[0] } ) { print $key, " ", $data{$formname}[0]{$key}, "\n"; }

HTH

If not P, what? Q maybe?
"Sidney Morgenbesser"

Replies are listed 'Best First'.
Re: Re: How to access info from the array
by gnangia (Scribe) on Nov 12, 2002 at 21:33 UTC
    Thank-you. That little tutorial was very useful.
    Thanks also to everyone who replied.
      The Data::Dumper module and its ilk in the Data:: namespace on CPAN might be useful also.