The mailbox was checked once every 30 minutes with a script that ran for 30 seconds, so simultaneous file access was high unlikely--but not impossible.Hmmm. If you are 'reading' a mailbox, as a mail client might, then it seems you wouldn't run into the need to lock the file.
I'd would approach the problem like so:
Seems like this would catch each new message, and not conflict with any incoming messages.my $mboxfhandle; # open $mboxfhandle for readonly my @mbox = <$mboxfhandle>; # Let's use lots of memory # rest of the process ...
( on further reflections, I imagine that a mail client must be able to mark messages as read, which would involve a write ... )
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday
In reply to Re^2: using Email to Perl to append to a changelog.txt, html, or .xls?
by freddo411
in thread using Email to Perl to append to a changelog.txt, html, or .xls?
by Sclous
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |