in reply to Re: How portable are common $! error codes?
in thread How portable are common $! error codes?

Note, if you call lots of -X operators in succession (i.e. for the same $_), you can use the special filehandle of a single underline to avoid repeating the stat(2) system call:
die "Can't read $_" unless -r; die "Can't write $_" unless -w _; die "Can't execute $_" unless -x _; die "$_ not a file" unless -f _; die "$_ not a directory" unless -d _;