Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: reading the hash information from a file

by palette (Scribe)
on Feb 16, 2007 at 14:04 UTC ( #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

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?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2023-06-04 21:08 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (22 votes). Check out past polls.