in reply to use of eval and Data::Dumper
#!/usr/bin/perl -w use strict; use YAML qw( DumpFile LoadFile ); my @ray=qw(bob me other); my %hash; foreach (@ray) {my %tmp=("one", "$_+1", "two", "$_+2", "three", "$_+3" +); %{$hash{$_}}=%tmp}; my $file_to_store = 'dump.txt'; DumpFile( $file_to_store , \%hash ); my $loaddata = LoadFile($file_to_store);
|
|---|