Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Testing if file exists

by !1 (Hermit)
on Oct 04, 2004 at 21:49 UTC ( #396408=note: print w/replies, xml ) Need Help??


in reply to Testing if file exists

Try this:

#!/usr/bin/perl -l use File::Spec; my $file = "$mall_path/keywords/$filename"; print "Checking " . File::Spec->rel2abs($file); if (-e $file) { #file exists - set variable and other things }

Update: Urg, too much Java earlier today. Changed + to . in print statement. Thanks shenme.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2021-09-28 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?