use Storable; $S{scalar} = 5; @{$S{array}} = (5, 6, 7, 8); %{$S{hash}} = (hi => 1, there => 2); Storable::store \%S, 'state.sav'; %S = %{ Storable::retrieve('state.sav') }; #### $"=$,,$_=q>|\p4<6 8p .q>.<4-KI;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/