Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: A perl buffer

by leonidlm (Pilgrim)
on Aug 10, 2008 at 15:20 UTC ( [id://703425]=note: print w/replies, xml ) Need Help??


in reply to Re^3: A perl buffer
in thread A perl buffer

Ahh now I see my problem:
My function receiving different parameters. For example I configured a database retrive function. As a parameter I receive the sql statement. Sometimes my application will call this retrive function with the same sqlstatement, only in this case I want to memorize it and return the "memorized" image without retriving the data again.
Now I hope I am clear :)
BTW thanks everyone for helping.

Replies are listed 'Best First'.
Re^5: A perl buffer
by dreadpiratepeter (Priest) on Aug 10, 2008 at 15:54 UTC
    that's fine. that is exactly what memoize does. If you called your memoized function with
    func('select * from table1')
    the second time you ran it with that input, it would simply return the cached value from the first call.
    And that is fine, if you don't care that the data may have changed in the db in the meantime.


    -pete
    "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-16 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found