You're clobbering %rets. You should instead do:

$rets{"$retid$fnum"} = { FNAME => $fn, RECLEN => $rl, LIAISON_EMAIL => $mle, LIAISON_FNAME => $mlfn, LIAISON_LNAME => $mlln, LIAISON_AREACODE => $mlac, LIAISON_PHONE => $mlpn, LIAISON2_EMAIL => $ml2e, LIAISON2_FNAME => $ml2fn, LIAISON2_LNAME => $ml2ln, LIAISON2_PHONE => $ml2pn, RETNAME => $retname, RETAILER_EMAIL => $rce, LIAISON2_AREACODE => $ml2ac, RETAILER2_EMAIL => $rc2e, FTPCHECK => $fc, RETID => $retid, SCRIPT_NAME => $scrname, EXECFLAG => $exec, FREQUENCY => $freq, FILE_NUMBER => $fnum };

Check out perldoc perldsc for more information.

I also noticed that you have if ($fnum eq "") { my $fnum = "_001" }. You are declaring a new $fnum that can only be seen within the scope of the if. In other words, $fnum will still be "" when you construct your anonymous hash. Perhaps instead you should replace the entire if with $fnum = "_001" if $fnum eq "";. I hope this helps you with your problem.


In reply to Re: Hash of anonymous hashes --- Oh my by !1
in thread Hash of anonymous hashes --- Oh my by sweetblood

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.