#!/usr/bin/perl use strict; use Storable; $Storable::canonical = 1; my %hash = ( x=> 'line 1', z=> [ 1, 2, 4], y=> { file=> 'test.txt', length=> 200, type => 'ASCII' }, a=> 'line 2' ); store \%hash, 'hashfile.txt';