Actually, that comment above is incorrect. The correct syntax is (-e $path_to_file)
-f is the flag used to determine if the file is a "plain" file (versus a directory or symbolic link).
So, to find if the file "/test.txt" exists, you would use the code:
if (-e "/test.txt") {
print "File Exists.\n";
}
Main Topics
Browse All Topics





by: dorwardPosted on 2004-03-09 at 05:05:37ID: 10549722
To test if a file exists:
(-f $path_to_file)