Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

|| die or or die :)

by snax (Friar)
on Jul 23, 2003 at 20:00 UTC ( #277316=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: system & shell metacharacters
in thread system & shell metacharacters

I'm just surprised that I've never seen a problem using it exactly as I've written it above, which I do with great regularity. The docs say that the calling signatures are

open FILEHANDLE, EXPR
and
open FILEHANDLE
My syntax falls into the first case, but what constitutes an "EXPR"? I've got a string, the || operator, then the die -- does that qualify as an EXPR? I'll have to poke around the docs some more.....

Oh. Playing around with the right and wrong way shows me that my "|| die" syntax fails without die-ing.


Comment on || die or or die :)
Select or Download Code
Re: || die or or die :)
by ChemBoy (Priest) on Jul 23, 2003 at 20:41 UTC

    I've got a string, the || operator, then the die -- does that qualify as an EXPR?
    Yes, it does (as you seem to have discovered): since || is higher precedence than the comma, it's parsed roughly as open ( FILEHANDLE, ("filename" || die( ...) ) ); Since your string is always true, the die is never reached.



    If God had meant us to fly, he would *never* have given us the railroads.
        --Michael Flanders

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://277316]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2014-07-29 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (227 votes), past polls