I actually just a few minutes ago removed the LIMIT from the split, and it made no difference alone.

I also added the following line directly before the split line:

if(!defined($hash{$key})) { print "key $key ($hash{$key}) not defined\ +n"; delete($hash{$key}); next; }

For values where $hash{$key} isn't defined, it still outputs this:

Use of uninitialized value in concatenation (.) or string at ./list_ha +sh.pl line 33. key spam-de102f8ac36e56326312e8701b3b4520-20120419T161342-05203-09-2.g +z () not defined

In other words, the key (the spam-de... filename) is defined, but the rest of the values of the record are not.

The rest of the values include the email's subject, so switching \t for \s+ won't work, because email subjects have spaces in them.

If I run this program again, it prints the same 'uninitialized value' line at the same spot. Why doesn't it delete() the record? Eventually the hash is "untied", so it's properly closed. That's the issue that really has me perplexed now.

Thanks,
Alex

In reply to Re^4: Deleting undefined entries from DB_FILE hash by gossamer
in thread Deleting undefined entries from DB_FILE hash by gossamer

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.