in reply to Re^3: specific array in hash of arrays
in thread specific array in hash of arrays

if (exists $hoh{$array_name}->{$to_find}) {
should normally be
if ( exists( $hoh{$array_name} ) && exists( $hoh{$array_name}->{$to_find} ) ) {

to prevent autovivification of entries into %hoh. That might not matter here, though.

Replies are listed 'Best First'.
Re^5: specific array in hash of arrays
by gone2015 (Deacon) on Oct 09, 2008 at 15:01 UTC

    Rats... "autovivication" :-(

    Just when I thought I was getting to grips with Perl magic, another piece bites me in the backside... "autovivifying" an rvalue ? ...of course, silly me !

      lvalue or rvalue doesn't matter. Treating an undefined variable as a reference will instantiate the referree and store a reference in the variable.

      Note that it's -> performing the autovivification, not exists.