I have this block of code:
# Build Host to Storage relationship and enter into database my %remove_dups; foreach my $host(keys %{$build_dwh{'h2s'}}) { my ($storID,$lcstorage,$lcalias); foreach my $keys(keys %{$build_dwh{'h2s'}{$host}}) { foreach my $arrayID (@{$build_dwh{'h2s'}{$host}{$keys}}) { my $lchost = lc($host); my $lcstor = lc($arrayID); my $cmpOne = $rtrn_prdb_id{'storage'}{$lcstor}; my $cmpTwo = $rtrn_prdb_id{'serial'}{$lcstor}; my $storID = ($cmpOne ? $cmpOne : $cmpTwo); if($storID) { my $htcref = join(".",$rtrn_prdb_id{'host'}{$lchost},$stor +ID); if(!$rtrn_prdb_id{'hTSId'}{$htcref}) { push @{$remove_dups{$storID}}, $rtrn_prdb_id{'host'}{$l +chost}; # push @h2s, [$rtrn_prdb_id{'host'}{$lchost},$storID]; } } } } } #processH2sLoad(@h2s); my %rebuild_h2s; foreach my $storArr(%remove_dups) { my %seen =() ; my @unique_array = grep { ! $seen{$_}++ } @{$remove_dups{$storArr}} +; $rebuild_h2s{$storArr} = \@unique_array; } foreach my $storArr(%rebuild_h2s) { my @shift_load = @{$rebuild_h2s{$storArr}}; #<--- Error Here for(my $i = 0; $i <=$#shift_load; $i++) { push @h2s, [$shift_load[$i],$storArr]; } }
it causes this error
Can't use an undefined value as an ARRAY reference at TEMP_load_OCI_Ho +stData_Complete.pl line 393.
when I dump the hash I get the following:
$VAR1 = 'ARRAY(0xdf95524)'; #<--- Can't get rid of this shouldn't be h +ere $VAR2 = []; $VAR3 = '102'; $VAR4 = [ '10045475', '10045476', '10045477', '10045478', '10045479', '10045480', '10045482', '10045481', '10045483', '10045484', '10045485', '10045486', '10045487', '10045488', '10045489', '10045490', '10045492', '10045491', '10045494', '10045493', '10045496', '10045495' ]
but not sure how to get rid of it;

In reply to Problem with undifined value as an ARRAY reference by mrras25

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.