in reply to Re: static-like persistence of my variable due to trailing conditional
in thread static-like persistence of my variable due to trailing conditional

Excellent. Thank you, shotgunefx. The link you provided led me to find a few good threads here at perlmonks and also on P5P (however, your link seems bad... I couldn't find 'my $x if 0' on that page).

1. Unusual Closure Behaviour

2. It *is* a feature: mod_perl and 'my $x if 0'

3. Google's cache of "This Week on P5P, 2000/05/21", which seems to contain the text 'my $x if 0; Trick' that shotgunefx was leading us to.

I guess the consensus is that this is a bug; er... feature. Anyway, I'll probably never again use trailing conditionals and initializations concurrently. Again, I am refused disappointment by the amazing Perlmonks! Thank you all.

-Adam
---
"A Jedi uses the Force for knowledge and defense, never for attack."
  • Comment on Re: Re: static-like persistence of my variable due to trailing conditional

Replies are listed 'Best First'.
Re: Re: Re: static-like persistence of my variable due to trailing conditional
by shotgunefx (Parson) on Jun 30, 2002 at 08:08 UTC
    No problem. It's been gone over quite a few times here but the 4 character maximum on search makes the threads hard to find.

    As an aside, the link does work for me in IE5. It's the second targeted link on the page at http://www.perl.com/pub/a/2000/05/p5pdigest/THISWEEK-20000521.html

    -Lee

    "To be civilized is to deny one's nature."
Re^3: static-like persistence of my variable due to trailing conditional
by Aristotle (Chancellor) on Jun 30, 2002 at 17:52 UTC
    *grin* It falls in a category that might best be described "unintended feature". Feature, because it is well within documented specifications and conforms to intended behaviour. But unintended, because noone anticipated there might be an interaction between the relevant specifications.

    Makeshifts last the longest.