[Wellington-pm] perl -f check failed

Jethro Carr jethro.carr at jethrocarr.com
Tue Jul 20 20:13:34 PDT 2010


hi Perl Mongers,

Long time lurker, probably first time posting here. :-)


PROBLEM

I'm come across an interesting problem with a perl script running a -f
file check.

Essentially the script creates a number of text files whilst running and
checks if any exist using -f - if they do, it knows to use a different
name for the new file.

This has been working nicely for hundreds of files a week for almost a
year, however the other day we experienced an issue where -f returned
false despite a file existing, which lead to some interesting
overwrites...


Annoyingly I've been unable to reproduce the issue when re-running the
script with the same inputs. >:-(

I'm putting it down to some obscure bug that we managed to trigger
*somewhere* at that particular instance of the script running, but would
be grateful for any ideas that might help.



IDEAS?

I'm wondering if anyone here has ever experienced problems like this, or
if there are situations where perl can return false even when a file
exists.

The files are created whilst the script is running, however I wasn't
aware of any situations where perl might still have cached the old
environment.

Other possibility is that there was an error on the OS level, telling
perl that the file didn't exist even if it did - maybe under heavy I/O
or some other issue?



ENVIRONMENT

Running perl 5.8.0 (as shipped with RHEL 3) so it is a little old,
probably a few bugs fixes there that Red Hat may not have back-ported...

Filesystem is a standard ext3 filesystem.



I'm pretty stumped about this one, a $beverage to anyone able to point
me towards the solution :-(

regards,
jethro

-- 
Jethro Carr
www.jethrocarr.com/index.php?cms=blog
www.amberdms.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.pm.org/pipermail/wellington-pm/attachments/20100721/80db1069/attachment.bin>


More information about the Wellington-pm mailing list