Re: Variable scoping, static variable

2003-03-29 Thread R. Joseph Newton
R. Joseph Newton wrote: Sorry, the function I proposed [see bottom] did not properly enclose the declaration, and thus would not have provided the protection I referred to.. Should have been: test_cache(); sub test_cache { my $cache = {}; test(hello0,$cache);

Re: Variable scoping, static variable

2003-03-28 Thread Janek Schleicher
Rob Anderson wrote at Fri, 28 Mar 2003 14:45:07 +: -- module sub routine sub test { my $param = shift; my $cache_key = param=$param; if (exists $cache{$cache_key}) { return $cache{$cache_key}; } sleep 1; $cache{$cache_key} = $param .

Re: Variable scoping, static variable

2003-03-28 Thread Rob Anderson
Thanks but I don't see how this could work. I've tried using it, but to no avail Janek Schleicher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Rob Anderson wrote at Fri, 28 Mar 2003 14:45:07 +: -- module sub routine sub test { my $param = shift;

RE: Variable scoping, static variable

2003-03-28 Thread Shishir K. Singh
: Rob Anderson [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 10:36 AM To: [EMAIL PROTECTED] Subject: Re: Variable scoping, static variable Thanks but I don't see how this could work. I've tried using it, but to no avail Janek Schleicher [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: Variable scoping, static variable

2003-03-28 Thread John W. Krahn
Rob Anderson wrote: I'm trying cache a function to help speed it up. Have a look at the Memoize module at CPAN. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]