You can use Data::Diver since it will decline to autovivify at every turn.

use strict; use warnings; use Data::Diver qw( Dive ); my $hash_ref = { '0000006' => [ 47, 986, { '6' => [ undef, 8, '0.0476673428', '0.0000000000', '0.0000000000', '0.0504833512', '-2.3718998111e+01', '6.7559883050e-01', '0.0000000000e+00', '0.0000000000e+00' ], '4' => [ undef, 3, '0.0476673428', '0.0000000000', '0.0000000000', '0.0502136752', '-2.3718998111e+01', '8.6357443606e-01', '0.0000000000e+00', '0.0000000000e+00' ], '1' => [ 19, 439, '0.0476673428', '0.0432801822', '0.0452380952', '0.0539499037', '-1.7611636075e-01', '3.3572455230e-01', '2.3371924011e-01', '4.6743848022e-01' ], '3' => [ 'NA' ], '2' => [ 22, 286, '0.0476673428', '0.0769230769', '0.0833333333', '0.0370370370', '8.1093021684e-01', '9.9753809371e-01', '9.9388971159e-01', '1.0000000000e+00' ], '5' => [ 6, 249, '0.0476673428', '0.0240963855', '0.0246913580', '0.0589080460', '-8.6952438185e-01', '2.6721209055e-02', '9.8480960134e-03', '1.9696192027e-02' ] } ] }; my %hash = %{$hash_ref}; ( $_, undef ) = each %hash; my @physh_found; foreach my $physh ( 1 .. 6 ) { # next if ! $hash{$_}[2]{$physh}[9]; next if !Dive( \%hash, $_, 2, $physh, 9 ); push @physh_found, $physh; } use Test::More tests => 2; is_deeply( \@physh_found, [qw( 1 2 4 5 6 )], 'found the right physhies' ); is_deeply( \%hash, $hash_ref, 'hash is unchanged' );

In reply to Re: searching through hash values by kyle
in thread searching through hash values by baxy77bax

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.