Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: die/warn bug in elsif

by merlyn (Sage)
on Jan 12, 2006 at 17:29 UTC ( [id://522758]=note: print w/replies, xml ) Need Help??


in reply to die/warn bug in elsif

die and warn are happening at runtime, and from the statement that begins on line 1, so it makes sense. The 0/0 is happening at compile time, where you're compiling line 4, so it also makes sense.

Well, "makes sense" because I know what's going on behind the scenes. :)

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: die/warn bug in elsif
by radiantmatrix (Parson) on Jan 13, 2006 at 15:04 UTC

    As a way of illustrating this point, here's the OP's first code block after being run through perl -MO=Deparse buggy.pl:

    if (die '4') { (); }

    The B::Deparse module (called by the above command) shows you the Perl equivalent of what the interpreter sees at runtime. This is extremely useful for finding this "compile-time vs. run-time" class of behaviors.

    <-radiant.matrix->
    A collection of thoughts and links from the minds of geeks
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found