Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Caching or using values across multiple programs

by nagalenoj (Friar)
on May 06, 2009 at 03:54 UTC ( #762149=note: print w/ replies, xml ) Need Help??


in reply to Caching or using values across multiple programs

You can use the DBM hash. Using DBM hash the data will get stored in a database file, and at the same time it is as easy as working with hashes. Here, is a sample code to work with DBM hashes,

#!/usr/bin/perl use strict; use warnings; my %hash; # To open a dbmfile and associate with hash dbmopen(%hash, "nagalenoj", '0666') || die "Can't open database file!" +; $hash{'one'}="1"; $hash{'two'}="2"; $hash{'three'}="3"; #Retrieving values print $hash{'three'}; dbmclose %hash;


Comment on Re: Caching or using values across multiple programs
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://762149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-04-16 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (434 votes), past polls