On Jul 15, Teresa Raymond said:
>opendir (ADS, "$filepath/") || die "Can't open directory\n";
>if (-e $file)
>{
> unlink "$file";
>}
Why are you opening a directory, but not using it? At first, I'd think
you meant to just say:
unlink "$filepath/$file" if -e "$filepath/$file";
But you say the -e works.
So I'm left assuming you don't have the permission to delete the file.
use CGI::Carp qw( fatalsToBrowser );
unlink $file or die "Can't delete $file: $!";
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
** Manning Publications, Co, is publishing my Perl Regex book **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]