Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: reading the hash information from a file

by palette (Scribe)
on Feb 16, 2007 at 14:04 UTC ( [id://600432]=note: print w/replies, xml ) Need Help??


in reply to reading the hash information from a file

If I have understood your problem then I think the code below can be one of the solution.

As In Perl they say there are more than one ways to do it.

Basically you want some form in which you can store the data to a file then you can collect the data back from the file to a variable. One way can be using Dumper, you can even use Storable.pm

You can store this hash like this in a file

use Data::Dumper; open(OUT,">/usr/home/hashtree"); print OUT Dumper(\%tree); close(OUT);


then whereever u want to retrieve the value back from this file to a variable you can use something like this.

use Data::Dumper; my $hashtree = do("/usr/home/psivaram/tree") or die $!; %tree = %{$tree};

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found