in reply to The or thing.
Btw: if you just want to know if there is something with the name $file.data (e.g. a file, a directory, a link, a socket, ...), -e is correct. But if you want to know if it is a file and not a directory or socket or link or the like, you could better use -f, e.g
if (-f "data/$file.data" or -f "data/$otherfile.data) { ...
see: perldoc -f -f
if you also want to execute the script from other directories (e.g. because it is in $PATH or %PATH%, like ls or dir), then the script would try to find "data/$file.data" in a wrong place. If you want to keep ./data/ relatively to your script but don't want to write an absolute path, you can use FindBin, e.g.
use FindBin; my $dataPath = "$FindBin::Bin/data"; if (-f "$dataPath/$file.data" or -f "$dataPath/$otherdata.data") { ...
this way is also often a good choise for Perl/CGI scripts because some webservers don't change there actual directory to the one your script is inside
Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"
|
|---|