in reply to "open" Best Practices
> It is best to also report the filename as well, and of course you're free to customize the message as needed.
About this I almost always use the filename within square brackets or single quotes, to avoid nasty empty space problems (even if your use, with filename as first element and followed by : can spot these problems too). I also spend more words in errors, just in case:
open my $fh, '<', $filename or die "Unable to open [$filename] becaus +e of: $!";
Also, being on unfortunate OS , sometimes I add $^E aka $EXTENDED_OS_ERROR ( under MSWIN32 $^E can be different from $! ):
open my $fh, '<', $filename or die "Unable to open [$filename] becaus +e of: $! $^E";
L*
|
|---|