AFAIK there is no metadata in an mbox file that determines if a particular message has been read or not? Please correct me if I am wrong.

The first thing I did was to run the podchecker program on yours and it produced two syntax errors.

Some comments:

159 sub wanted 160 { 161 my $file = $File::Find::name; 162 163 # 164 # We only care about files. 165 # 166 return if ( -d $file );

I guess you are assuming that there are no named pipes or FIFOs or other types of files?

167 168 # 169 # Skip some mailboxes. 170 # 171 foreach my $exclude ( split( /,/, $CONFIG{'exclude'} ) )

What if you have a file name with a comma in it?

172 { 173 if ( $file =~ /$exclude/i )

What if you have a file name with a regex meta-character in it? What if the contents of $exclude are a subset of a larger file name? $file includes the complete path so $exclude could match on one of the path names. What if you want to exclude 'file' but not 'FILE'?

174 { 175 $CONFIG{'verbose'} && print "Excluded mail file: $ +file\n"; 176 return; 177 } 178 } 179 180 181 # 182 # Skip files if they've not been modified too recently. 183 # 184 my $time = -M $file; 185 if ( defined( $time ) ) 186 { 187 if ( $time > $CONFIG{'time'} ) 188 { 189 $CONFIG{'verbose'} && print "Mail file not modifie +d recently: $file\n"; 190 return; 191 } 192 } 193 else 194 { 195 $CONFIG{'verbose'} && print "Failed to stat: $file - $ +!\n";

You report an error if you cannot stat the file but not at line 166?

196 return; 197 }

HTH

Edit: g0n - moved comments out of code tags


In reply to Re: Show mbox files with unread mail messages in them by jwkrahn
in thread Show mbox files with unread mail messages in them by skx

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.