Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Safe File Handling

by vek (Prior)
on Nov 06, 2005 at 07:26 UTC ( [id://506087]=note: print w/replies, xml ) Need Help??


in reply to Safe File Handling

The -e filetest will give you what you need.

my $filename = 'somefilename'; if (-e $filename) { print "File $filename already exists.\n"; } else { # create the file here... }

-- vek --

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found