Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: A (kinda) Circular Cache

by mr.nick (Chaplain)
on Mar 24, 2001 at 00:06 UTC ( [id://66723]=note: print w/replies, xml ) Need Help??


in reply to Re: A (kinda) Circular Cache
in thread A (kinda) Circular Cache

in your get method will return undef if $data is not defined (at least, if the sub's been called in a scalar context, which it will be, right?), so you could probably just get rid of that first line.

Hehe, I'm terrified of that situation now. I spent probably 10 hours a couple of weeks ago tracking down a problem that was caused by scalar/array contexts and "return" vs. "return undef". I'm playing it safe from now on.

Should have did the $size=shift || 30 thing myself though!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-07-23 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.