http://www.perlmonks.org?node_id=376324


in reply to Opening a File If It Exists

Test for existance using the -e operator. See perldoc -f -X for more info. For example:
if (-e "some_file") { # do your thing }