Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: delete a file

by Anonymous Monk
on Jun 16, 2005 at 10:08 UTC ( [id://467234]=note: print w/replies, xml ) Need Help??


in reply to delete a file

What happens if you write that as:
if (-e "data/remove.txt") { unlink "data/remove.txt" or die "unable to delete $!"; }

Are you sure you are using the filehandle >>? That's a pretty weird name for a filehandle. Or do you mean that you are using the append mode when opening a file? If so, why use append if the file isn't supposed to be there in the first place? It's not wrong (although I'm not sure if opening of a non-existing file using append mode actually works on all platforms), but people usually open a non-existing file in write only mode.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://467234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-18 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found