in reply to Hash dereference breaks from 5.8.9 to 5.10.1

There was a bug in Perl where

${%$Hash_reference}

was equivalent to

${\%$Hash_reference}

instead of evaluating the hash in scalar context. Apparently, 5.8.9 suffered from this bug, but 5.10.1 did not. The proper syntax is

${ ... expression that returns a hash reference ... }{ ... }

so the following makes no sense:

${ %$Hash_reference }{ ... }

You should have been using

${$Hash_reference}{$values[0]} = \@values;

which is clearer when written as follows:

$Hash_reference->{$values[0]} = \@values;

Replies are listed 'Best First'.
Re^2: Hash dereference breaks from 5.8.9 to 5.10.1
by Dwakus (Initiate) on Dec 06, 2011 at 21:04 UTC

    That just made my day. This is a legacy script that everybody hates, and this gives us yet another thing for which to mock it.