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."