Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: reading the hash information from a file

by bobf (Monsignor)
on Feb 16, 2007 at 07:14 UTC ( #600375=note: print w/replies, xml ) Need Help??

in reply to reading the hash information from a file

I'm not exactly sure I understand your question, but if you've got a hash dumped to a file (from something like print Dumper( \%hash )) and you trust the file source, you could read it in to a string and eval it.

If you are using the file as a simplified database, you may want to consider DBM::Deep or Storable.

Replies are listed 'Best First'.
Re: reading the hash information from a file
by b10m (Vicar) on Feb 16, 2007 at 09:01 UTC

    ... or YAML


    All code is usually tested, but rarely trusted.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://600375]
[james28909]: i figured out a neet trick
[Lady_Aleena]: james28909, what neat trick?
[james28909]: now if i have packed a script into a PDK exe, and misplaced the source, i can print it.
[james28909]: but you have to prepare for it first by adding this to the source
[james28909]: seek DATA, 0, 0; while (<DATA>) { print; }
[Lady_Aleena]: Sounds interesting. Have you written a meditation or cool use for it?
[Lady_Aleena]: It might be something PerlMonks at large would be interested in.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-05-01 00:06 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (543 votes). Check out past polls.