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);
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 .
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;
: 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
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]