Re: check to see if file exists.

2001-05-10 Thread Paul
--- Peter Lemus <[EMAIL PROTECTED]> wrote: > Hi, I need to check to see if a file exists in a > directory, if it does then delete it, else .. > > is this the correct syntax? > > if (-e $file and -f _) { > system ("del $file") ? print "File $file deleted\n" > : warn "File $file WAS removed:

RE: check to see if file exists.

2001-05-10 Thread Nic LAWRENCE
Never seen system with that syntax before... here's what I'd do though: if (-e $file) { if (unlink $file) { warn "File $file WAS removed."; } } That's just my first guess though having not tested it. :) > -Original Message- > From: Peter Lemus [mailto:[EMAIL PROTECTED]] > Sent: