Wednesday, March 11, 2009
How to tell if a file exists in perl?
#!/usr/bin/perl -w
$filename = '/path/to/your/file.doc';
if (-e $filename) {
print "File Exists!";
}
that the file does not exist - by using the unless conditional:
unless (-e $filename) {
print "File Doesn't Exist!";
}
$filename = '/path/to/your/file.doc';
if (-e $filename) {
print "File Exists!";
}
that the file does not exist - by using the unless conditional:
unless (-e $filename) {
print "File Doesn't Exist!";
}
Subscribe to:
Posts (Atom)