Wouldn't putting the call to memoize in a BEGIN block do the trick?
On Thu, Jun 27, 2013 at 12:48 PM, Issac Goldstand <mar...@beamartyr.net>wrote: > On 27/06/2013 12:44, Meir Guttman wrote: > > Dear Shmuel, > > > > > > > > > > > > *From:*perl-boun...@perl.org.il [mailto:perl-boun...@perl.org.il] *On > > Behalf Of *Shmuel Fomberg > > *Sent:* יום ה27 יוני2013 12:26 > > *To:* Perl in Israel > > *Subject:* [Israel.pm] Exporting a Memoized function > > > > > > > > Hi All. > > > > > > > > If I want to memorize a function: > > > > > > > > memoize('myfunc'); > > > > > > > > A newbie’s (really) stupid question: what is “memorize” in a Perl > > context? (Or is it a Perl issue?) > > > > > > > > Memoizing is a way of caching the results of a deterministic and > presumed expensive function, so it only runs the real function once (or > once in a while) and otherwise saves the output of a given set of > arguments in a cache and returns the cached answer when the inputs match. > > See http://en.wikipedia.org/wiki/Memoization > > > but I also want to export it. Is there anything that I need to worry > about? > > > > > > > > What happen if I memoize the function *after* it was already exported? > > > > does the exported function points to the regular or to the memoized > > function? > > > > > > > > Thanks, > > > > Shmuel. > > > > > > > > _______________________________________________ > > Perl mailing list > > Perl@perl.org.il > > http://mail.perl.org.il/mailman/listinfo/perl > > > > _______________________________________________ > Perl mailing list > Perl@perl.org.il > http://mail.perl.org.il/mailman/listinfo/perl > -- Gaal Yahas <g...@forum2.org> http://gaal.livejournal.com/
_______________________________________________ Perl mailing list Perl@perl.org.il http://mail.perl.org.il/mailman/listinfo/perl