Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: If File Exists

by muppetBoy (Pilgrim)
on Jun 19, 2000 at 13:21 UTC ( [id://18779]=note: print w/replies, xml ) Need Help??


in reply to If File Exists

Try:
if (-e "$ENV{REMOTE_ADDR}.$ENV{HTTP_COOKIE}.txt") { do something if file exists } else { file does not exist }
Check out How do I test if I file exists without attaching a filehandle to it?.

Replies are listed 'Best First'.
POTENTIAL SECURITY HOLE
by merlyn (Sage) on Jun 19, 2000 at 17:56 UTC
    No. Don't use anything starting with HTTP_ directly in any file path. This is an arbitrary string coming from the browser, and can be manipulated directly by a person with ill intentions.

    -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-28 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found