Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Image::EXIF saves data to a hash reference. I can dump it all using print %$hash_ref but it fails when I try to use
use Image::EXIF; my $exif = new Image::EXIF("/home/public_html/test/IMG_3212.JPG"); my $image_info = $exif->get_image_info(); # hash reference foreach my $key (keys %$image_info) { print qq($key : %$image_info{$key}<br>); }
Can someone enlighten me?

Replies are listed 'Best First'.
Re: Printing hash references for Image::EXIF
by ikegami (Patriarch) on May 13, 2008 at 00:11 UTC

    See Dereferencing Syntax and/or References Quick Reference.

    Where you would do %hash, you do %{$hashref} (curlies optional) like did for keys. Similarly,
    where you would do $hash{$key}, you do ${$hashref}{$key} (curlies optional) or $hashref->{$key}.

      I love you man.

      Not only did you give me the answer but explained how to do it.

      You're the best!