Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: checking for a file

by dada (Chaplain)
on Aug 02, 2002 at 14:02 UTC ( #187091=note: print w/replies, xml ) Need Help??


in reply to checking for a file

if(-e "/bin/do/foo/$targetFile") { print "is there!\n"; } else { print "someone stoled it...\n"; }
cheers,
Aldo
__END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;

Replies are listed 'Best First'.
Re: Re: checking for a file
by Massyn (Hermit) on Aug 02, 2002 at 14:26 UTC
    I'd rather go with
    if(-f "/bin/do/foo/$targetFile") { print "is there!\n"; } else { print "someone stoled it...\n"; }
    to check if it's actually a file (that exists), as the -e may also return true on a directory.
      Thanks all , I was able to figure it out with the -f ,, thank you again

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2022-05-25 04:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (84 votes). Check out past polls.

    Notices?