in reply to Re: unless vs. bare block
in thread unless vs. bare block

As an alternative, you could first check via -f $file that the file exists and return with a warning if it does not exist and die only if it exists yet the open fails.

But that is a race condition :) The file could become exist after you check with -f

use Errno ;

open ... or do { if( $!{ENOENT} ){ warn "Uh oh '$file': $!" ; return; } die "Uh oh, unexpected '$file': $!"; }