in reply to Storable with hash of hashes (reference problem?)
Of course the array and hash are empty but you already seem to understand how to fill them and read them back.#!/usr/bin/perl use strict; use warnings; use diagnostics; use Data::Dumper; my @array; my %hash; #save the array open (FILE,">array.dat"); print FILE Data::Dumper->Dump([\@array],['*array']); close (FILE); #save the hash open (FILE,">hash.dat"); print FILE Data::Dumper->Dump([\%hash],['*hash']); close (FILE); # read in the array open (FILE,"array.dat"); undef $/; eval <FILE>; close(FILE); # read in the hash open (FILE,"array.dat"); undef $/; eval <FILE>; close(FILE); exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Storable with hash of hashes (reference problem?)
by tilly (Archbishop) on Oct 12, 2003 at 02:59 UTC |