主要就是 -e 这个操作符 ( e 即是 "exist" ) $fileExist = -e "nrpe"; if ( $fileExist ) { print "Yes\n" } else { print "No\n" }