使用perl判断某文件是否存在:
#!/usr/bin/perl -w my $file = "/home/zl/study/perl/fileexist/t.txt"; if(-e $file){ print "t.txt exist. \n"; }else{ print "do not exist. \n"; }
参考 : http://bbs.chinaunix.net/thread-1866833-1-1.html