in reply to Perl hashes revisit

print $test->dest->flags
Replace this with
print $test->{dest}->{flags}
or
print $test->{dest}{flags}
In Perl, the syntax you used is only for method calls, not for hash items. I know that in a lot of other languages the difference between the two isn't so large...

Replies are listed 'Best First'.
Re^2: Perl hashes revisit
by perlpreben (Beadle) on Feb 14, 2009 at 20:03 UTC
    i was unable to get any data doing it in that way... And Ive tried to read the documentation as well to better understand this.. but im still having problems. And its getting the better of me!
      Is your variable $test or %test? The code is for $test (a scalar variable, containing a hashref). If it is %test (a hash variable), change the code to
      print $test{dest}->{flags}
      or
      print $test{dest}{flags}