CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Caching between sessions

 



SunWuKung
New User

Apr 25, 2002, 2:11 PM

Post #1 of 1 (1179 views)
Caching between sessions Can't Post

Hi,

I am trying to put togather a script that will be called from an other application. Unfortunately the startup of the script is very slow because it reads a lot of data in. This data is static. Could somebody suggest a way how to solve that I would only need to wait for this reading once and on subsequent calls the data would already be cached?

Below is what I tried, but it returned a Can't store GLOB items error. Maybe I am doing the whole thing wrong.

Anybody any suggestions? Many thanks for the help.

SWK



use WordNet::QueryData;
use Cache::FileCache;

my $cache = new Cache::FileCache( );
my $wn = $cache->get( $cache );
if ( not defined $wn ) {
my $wn = WordNet::QueryData->new; ------ this is the line that takes a long time
$cache->set( $cache, $wn, "10 minutes" ); ------ this is the line returning the error
}

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives