in reply to 'or' vs '', '&&' vs 'and'

For opening files I like to do this ...
if( !open( FH, "<$file") ) { die "Cannot open $file :$!\n"; }
... just reminds me of C.

Replies are listed 'Best First'.
Re: Re: 'or' vs '', '&&' vs 'and'
by simon.proctor (Vicar) on Apr 02, 2002 at 00:31 UTC
    I much prefer the 'unless' version of this as for me (who needs new glasses) I can sometimes miss the ! so I prefer.
    unless(open( FH, "<$file") ) { # Error code, logging, bits, bobs (etc etc) die "Cannot open $file :$!\n"; }

    As a matter of personal taste I think this is more natural (to me).. unless this do this ;P