http://qs321.pair.com?node_id=761979


in reply to Deleting a File in Windows

unlink("C:/Users/deadpickle/file/to/delete") or die "Can't delete a fi +le\n";

Replies are listed 'Best First'.
Re^2: Deleting a File in Windows
by Anonymous Monk on May 05, 2009 at 19:59 UTC
    • deadpickle's path appears well formed, meaning he knows how to escape slashes, so forward slashes aren't needed.
    • Usually you want to know why unlink failed (and on what line)
    my $filename = qw[ C:\Users\deadpickle\Desktop\UAS\GRRUVI_1.60\panel\U +AS01 ]; unlink $filename or die "Couldn't unlink($filename) : ($!)($^E)"; __END__ Couldn't unlink(C:\Users\deadpickle\Desktop\UAS\GRRUVI_1.60\panel\UAS0 +1) : (No such file or directory)(The system cannot find the path spec +ified) at - line 2.