[Israel.pm] Exporting a Memoized function

Issac Goldstand margol at beamartyr.net
Thu Jun 27 02:46:27 PDT 2013


You can wrap it as
sub myfunc {
  return memoize('myrealfunc');
}

and export that way...

On 27/06/2013 12:36, Shmuel Fomberg wrote:
> On Thu, Jun 27, 2013 at 6:26 PM, Shmuel Fomberg wrote:
> 
>     Hi All.
> 
>     If I want to memorize a function:
> 
>     memoize('myfunc');
> 
>     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?
> 
> 
> I tested it, and it seen that the exported is the regular function. 
> Oh well. one level of indirection never killed anyone...
> 
> Shmuel.
> 
> 
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl
> 



More information about the Perl mailing list