Chris wrote:
> I can now turn the %hash into text, but I don't understand how to make it
> correctly formatted.
>
> -----------------------------------
> %hash = (
> 'John' => {
> 'eyes' => 'green',
> 'hair' => 'brown',
> 'clothes' => { 'boots'=>'black','shirt'=>'green' }
> },
> 'Jane' => {
> 'height' => '6',
> 'weight' => '120',
> 'clothes' => { 'skirt'=>'white','sandals'=>'tan'}
> }
> );
>
>
> use Data::Dumper;
> print Dumper(%hash);
print Dumper (\%hash);
Look at using Storable :
use Storable qw(freeze thaw);
my $serial = freeze \%hash; # serialize the hash
my %hash2 = %{thaw ($serial)}; # thaw it
print Dumper (\%hash2); # dump for comparison
__END__
> ----------------------------------
>
> This returns the following...
>
> $VAR1 = 'Jane';
> $VAR2 = {
> 'clothes' => {'sandals' => 'tan','skirt' => 'white'},
> 'weight' => '120',
> 'height' => '6'
> };
> $VAR3 = 'John';
> $VAR4 = {
> 'clothes' => {'shirt' => 'green','boots' => 'black'},
> 'hair' => 'brown',
> 'eyes' => 'green'
> };
>
>
> This is close to the original, but not correct.
--
,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED]
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs