Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: die/warn bug in elsif

by merlyn (Sage)
on Jan 12, 2006 at 17:29 UTC ( #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

    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.

    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?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2020-01-18 14:26 GMT
Find Nodes?
    Voting Booth?