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

What about

unless ( open INFILE, "<", $file ) { return unless -f $file; die "open failed: $!"; }
Of course it's possible that you will not print the error message if someone removes the file between the open() and the -f. Don't know if that matters to you.

Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Edit by castaway: Closed small tag in signature