if( open( IN, '<', $somefile ) ) { # it's there, do something with it close(IN); } else { warn "wasn't able to open $somefile (reason=$!)\n"; }