Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: [BUG||FEATURE] Lexical variable saves state after out of scope

by davido (Archbishop)
on Apr 26, 2012 at 08:18 UTC ( #967260=note: print w/replies, xml ) Need Help??

in reply to [BUG||FEATURE] Lexical variable saves state after out of scope

  • It's a feature if you are writing obfu.
  • It's a punishable offense if you use it anywhere else.
  • It's a bug waiting to happen if you're coding under the cognitive handicap of sleep deprivation.
  • It's what the C++ people love to refer to as "Undefined behavior."


  • Comment on Re: [BUG||FEATURE] Lexical variable saves state after out of scope

Replies are listed 'Best First'.
Re^2: [BUG||FEATURE] Lexical variable saves state after out of scope
by eyepopslikeamosquito (Chancellor) on Apr 26, 2012 at 13:06 UTC

    It's what the C++ people love to refer to as "Undefined behavior."
    Which reminds me of an amusing exchange on P5P in 2004:

    In scalar context, the behaviour of sort() is undefined.

    -- from perldoc -f sort

    The other strawman I use is "sort in a scalar context might just play Nethack"

    -- Randal L. Schwartz on P5P, June 10 2004

    A patch is attached. It's incompatible with David's 'sortedness' patch, and fails if nethack is not in the user's path.

    Configure should be expanded to detect rogue-like games that are available on the system, so that an appropriate one can be started if nethack is not installed.

    My original goal was for sort to play nethack when called in a void context, however it appears that Perl is smart enough to optimise this instance away.

    -- Paul Fenwick's response

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967260]
marioroy At a large firm, had to awaken a security guy a few times so that nobody would catch him sleeping.
marioroy On a large dairy farm, almost went off the road with a 10 wheeler from exhaustion. On the farm, almost went off the silo with a big tractor. At the Fransiscan monastery, almost slipped off the dome while painting it.
[marioroy]: In Saudi Arabia caught fire but didn't burn. I think angels exist.
Lady_Aleena clean up after dinner finally.
[Discipulus]: uch! so we are twice lucky to have MCE..;=)
[marioroy]: Working a midnight graveyard shift, on the way home ran out of gas. just 2 minutes later somebody stops with a small tank of gas. It's wierd. There's always someone nearby for some reason.
[Lady_Aleena]: I was the one who stop[ed in the middle of a cold night to pick up a small family walking to a gas station. I got a few gallons of free gas for the round trip, and the grandmother said she'd pray for me.
[marioroy]: Folks do not know it, but MCE was ridiculously difficult. At Niagra Falls, heard a voice on enabling Grace while in the mist boat. That 10x performance is possible.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-05-29 08:24 GMT
Find Nodes?
    Voting Booth?