Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: my $foo if 0; is a bug

by MeowChow (Vicar)
on Jul 15, 2001 at 07:42 UTC ( #96818=note: print w/ replies, xml ) Need Help??


in reply to my $foo if 0; is a bug
in thread It *is* a feature: mod_perl and 'my $x if 0'

You make a very good point, and one that I whole-heartedly agree with. As I said, I wouldn't use this sort of thing in real code, but I thought it's worth demonstrating that there are cases where it's quite useful to be able to declare a variable of static lifetime without having to create an enclosing scope. Yes, I see that it can be done with tie, though I usually avoid tied variables after having had a few nasty experiences with their performance. The requisite caller voodoo makes a tied implementation even less appealing.

   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on Re: my $foo if 0; is a bug

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-07 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls