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


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