Do you have any prove that chmod and unlink were executed? Maybe $file_name has the wrong value, and so the '-e' test failed, and none of the if loop executed. I suggest expanding your test to:
if ( -e $file_name ) { say "Deleting $file_name." chmod 0777, $file_name or die "Could not delete $file_name: $!; unlink $file_name; } else { say "In the else branch: '-e $file_name was false'."; }
Update - added missing $$$$
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In reply to Re: Deleting or unlinking a file
by TomDLux
in thread Deleting or unlinking a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |