Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Think about Loose Coupling

Comment on

Every once in a while I mistype someting like:
open(F, "<$somefile") || { print "Could not open file\n"; exit 3; }
which results in a syntax error. I've always wondered why this isn't allowed to work. Does anyone have a link to a discussion of why this is? Or a quick dissertation on the topic that can be cut and pasted in? Of course there are lots of ways to work around this, no need to explain, the most obvious being
if (! open(F, "<$somefile")) { print "Could not open file\n"; exit 3; }
Being a Perl true believer I disdain a C-ish expression when someing more Perlish is possible ... Thanks, --w

In reply to Looking for discussions of "block after or" syntax error by wsanders

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (4)
    As of 2014-03-14 01:38 GMT
    Find Nodes?
      Voting Booth?

      Have you used a cryptocurrency?

      Results (293 votes), past polls