Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to convert Storable object back to a hash

by Discipulus (Canon)
on Jun 21, 2023 at 07:13 UTC ( [id://11153059] : note . print w/replies, xml ) Need Help??


in reply to How to convert Storable object back to a hash

Hello cormanaz,

maybe too early in the morning and low coffeine level still, but.. what's wrong with Storable#EXAMPLES?

use Storable qw(store retrieve freeze thaw dclone); %color = ('Blue' => 0.1, 'Red' => 0.8, 'Black' => 0, 'White' => 1); store(\%color, 'mycolors') or die "Can't store %a in mycolors!\n"; $colref = retrieve('mycolors'); die "Unable to retrieve from mycolors!\n" unless defined $colref; printf "Blue is still %lf\n", $colref->{'Blue'};

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.