in reply to Get one element from anonymous hash

print "$$data{'firstname'}\n";

Likely you want print "$data[0]{'firstname'}\n"; or what ever array index you need.

for my $i (0 .. $#data) { print $data[$i]{firstname}, "\n"; }

Replies are listed 'Best First'.
Re^2: Get one element from anonymous hash
by Anonymous Monk on Mar 23, 2014 at 22:44 UTC
    Yes, that's right, thank you!
Re^2: Get one element from anonymous hash
by Anonymous Monk on Mar 23, 2014 at 23:43 UTC
    What if I need to add an element to it?
      You have an "Array of hash-refs" - usually referred to as AOH.

      Adding data is like adding to the end of an array:

      push @data, { 'firstname' => 'Suzy', 'lastname' => 'Wong', 'id' => '5253', 'email' => 'test2@test.com', 'date' => '04/03/2014', 'olddate' => '04-23-2013', 'page' => 'no page', };

              What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
                    -Larry Wall, 1992

      for my $i (0 .. $#data) { $data[$i]{'stuff'} = 'more stuff'; }