I'm not sure exactly what you want Data::Dumper to output here.. Look at what you've written:
my $var = {'one', 'two', 'red', 'blue'}->{'fish'};
Another way of writing it:
my %hash = (one => 'two', red => 'blue'); my $hash_ref = \%hash; my $var = $hash_ref->{fish};
Since the anonymous hash doesn't have a key named fish, you get undef when using fish as a hash subscript. I'm having trouble seeing the parallel between the example hash and the "real world" hash you present...

Do you want to search the hash based on some inner structure? You can only fetch things based on the key, not what's in the value, as that's what hashes are for. You'll have to make some sort of reverse-lookup hash to fetch things by the ext array.

Update: I get it now, but I still don't think the code you had should raise an error. It's a hash dereference of a valid hash.

blokhead


In reply to Re: strict and warnings but no error? by blokhead
in thread strict and warnings but no error? by cLive ;-)

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.