See -X for the -f operator, and see perlvar for $? resp. system.
In reply to Re: checking for existence of a file in perl by Corion in thread checking for existence of a file in perl by usrlocal