Using store function to save hash value to a file : Storable « File « Perl






Using store function to save hash value to a file

    

use Storable;

%hash = (
    meat => turkey,
    drink => tea,
    cheese => colby,
);

store(\%hash, "hash.dat");

%hash2 = %{retrieve("hash.dat")};

print $hash2{drink};

   
    
    
    
  








Related examples in the same category

1.Using store function to save array to a file