Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Hash to Scalar?

by ph0enix (Friar)
on Dec 09, 2002 at 13:43 UTC ( [id://218515] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Storable qw(nfreeze thaw);
    $scalar = nfreeze(\%hash);
    %hash_copy = %{ thaw($scalar) };
    
  2. or download this
    use Tie::RDBM;
    tie %h,Tie::RDBM,'mysql:test',{table=>'Demo',create=>1,autocommit=>0};
    $h{'key1'} = 'Some data here';
    ...
    print $h{'key3'}->{complex}->[0];
    tied(%h)->commit;
    untie %h;