Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: my $cache = undef if undef;

by ysth (Canon)
on Jan 27, 2005 at 06:32 UTC ( #425480=note: print w/replies, xml ) Need Help??


in reply to Re^3: my $cache = undef if undef;
in thread my $cache = undef if undef;

It may very well be gone someday in perl5. Really. Don't use it. Also note that the staticness is relative to the pad, not the function; for instance, the data does not persist for recursive calls to the function.

Replies are listed 'Best First'.
Re^5: my $cache = undef if undef;
by Aristotle (Chancellor) on Jan 27, 2005 at 17:28 UTC

    If you look a few nodes further up the thread you'll see I'm advising against its use anyway. :-) I'm simply saying that there is a lot of inertia against its disappearance. That's not a promise, of course. It does work in the meantime though, and can very occasionally be useful so long as we're talking about throwaway code (I used it in a oneliner once to save a few keystrokes.)

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://425480]
help
Chatterbox?
[ambrus]: Corion: what I don't understand is, if you make a one-shot AnyEvent timer with short timeout, does this code guarantee that the Prima timer can't queue two timeout events before invoking any of them?
[ambrus]: Because that could break AnyEvent code, which is why I added a guard.
[ambrus]: (It might be easier to use the callback scalar as a guard, as in $c and &$c(); $c = ();)
[Corion]: ambrus: Hurr - yes, that might happen, as Prima will queue lots of stuff (Well, Windows will)
[Corion]: But I'm really amazed that it just took this little code (plus the idle handler I have in mind and something else dk suggested)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2016-12-09 09:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.