#!/usr/bin/perl use strict; use warnings; use Storable; my %h2; my %hash = ( 'roster' => { 'mike' => 'biology', 'carol' => 'math', 'tom' => 'history', }, 'courses' => { 'math' => 'full', 'biology' => 'open', 'art' => 'open', } ); store(\%hash, "test.dat"); %h2 = %{retrieve "test.dat"}; for (sort keys %h2) { print $_, " ", %{$h2{$_}}; }