in reply to Re: References and state-saving
in thread References and state-saving
And here's the same thing with Storable:#!/usr/bin/perl -w use Data::Dumper; my %hash = ('foo' => 'bar', 'camel' => 'beast', 'bug' => 'spray'); #dump the structure open (FILE, '>/tmp/hash') or die "$!\n"; print FILE Dumper(\%hash); close FILE; #recreate the structure open (FILE,'/tmp/hash') or die "$!\n"; my $data = do { local $/; <FILE> }; my %newhash = %{eval $data};
use Storable; store \%hash, '/tmp/hash'; my %newhash = %{retrieve('file')};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: References and state-saving
by chipmunk (Parson) on Jan 13, 2001 at 21:25 UTC | |
by BlueLines (Hermit) on Jan 17, 2001 at 02:27 UTC |