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.
In reply to Re: Testing if file exists
by !1
in thread Testing if file exists
by hoffj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |