Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Storing hash with key & value in a file

by vinoth.ree (Monsignor)
on Dec 16, 2014 at 10:04 UTC ( [id://1110473]=note: print w/replies, xml ) Need Help??


in reply to Storing hash with key & value in a file

Hi,

Check Storable module.

Example:
use Storable; store \%hash, 'filename'; $hashref = retrieve('filename');

This code stores the %hash into filename, the last line retrieves the stored hash from the file. if you wanted a hash instead of a hash reference, wrap the "retrieve" call in side %{}

my %original_hash = %{retrieve('filename')};

All is well

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found