I am trying to run through a hash an check certain values from each key to re-assign the keys to other hashes. I have tried many different logic structures and I keep arriving at the same error "Can't coerce array into hash" I would appreciate some aoutside perspective, here is my current sub-routine:
sub check_dcr { my(@keys) = keys %temp_dcr; foreach $key (@keys) { if ("$temp_dcr{$key}{RightNavLaunchDate}" le $today) { if ("$temp_dcr{$key}{ShowPersonal}" eq "Personal") { $pers_dcr_files{$key} = $temp_dcr{$key}; } if ("$temp_dcr{$key}{ShowHome}" eq "Home") { $home_dcr_files{$key} = $temp_dcr{$key}; } if ("$temp_dcr{$key}{ShowBusiness}" eq "Business") { $bus_dcr_files{$key} = $temp_dcr{$key}; } } # End if statement to check for Launch Date } # End foreach loop to check all keys in the temporary hash } # End routine to check the temp hash and send out keys to specified +hashes
The program does not even seem to get into the first if statement... thanks, bill

In reply to Hash Problems by wstarrs

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.