in reply to Re^4: Cannot dereference hash in subroutine....
in thread Cannot dereference hash in subroutine....

Yes, that's exactly what I'm saying.

Within your subroutine your have a reference to a hash (in $mp3hash). The way to look up a value in a hash that you only have a reference to is to use $mp3hash->{KEYNAME}. You are using $mp3hash{KEYNAME} (without the dereferencing arrow). The syntax that you are using is trying to look up a value in the hash %mp3hash, but you don't have a hash called %mp3hash, you have a hash reference called $mp3hash. There's an important difference between the two.

And, as I said in my first post on this thread, if you were using use strict in your code then Perl would tell you that you were trying to access an unknown variable.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

  • Comment on Re^5: Cannot dereference hash in subroutine....