Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Using Storable Module with Multiple Hashes

by Thilosophy (Curate)
on Jun 20, 2005 at 11:43 UTC ( #468279=note: print w/replies, xml ) Need Help??


in reply to Re: Using Storable Module with Multiple Hashes
in thread Using Storable Module with Multiple Hashes

Or a hash of hash refs, if you like to retrieve them by name later.

In both cases, if you want to store hashes %a, %b, and %c with Storable, just store the compound structure instead:

use Storable; store [ \%a, \%b, \%c] , 'file'; # or store { a => \%a, b => \%b, c => \%c} , 'file'; my $arrayref = retrieve('file'); my $a = $arrayref->[0]; # or my $hashref = retrieve('file'); my $a = $hashref->{a};

Replies are listed 'Best First'.
Re^3: Using Storable Module with Multiple Hashes
by merrymonk (Friar) on Jun 20, 2005 at 16:48 UTC
    That works well.
    Just in case anyone else needs to use this
    I think that the actual hashes are found by
    %aa = %{$hashref->{a}}; %bb = %{$hashref->{b}};
    Thanks to the Janaury helper monk

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2016-09-28 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (529 votes). Check out past polls.