[Omaha.pm] Pulling in a hash via "exec"...FAIL

Jay Hannah jay at jays.net
Wed Aug 6 18:37:50 PDT 2008


On Aug 6, 2008, at 8:03 PM, Dan Linder wrote:
> When I'm able to re-write the entire system I'll look at that. :-)

"The entire system?" Here's my Storable version of what you posted to  
the list today:


$ cat j.pl
use Storable;

my $fields = {
    'FIELD1' => {
       FIRSTNAME => 'Joe',
       LASTNAME => 'Smith'
     }
};

# Write to disk:
store $fields, 'myfile.txt';

# Destroy memory version:
undef $fields;

# Restore from disk:
$fields = retrieve('myfile.txt');

# Show that it worked:
printf("%s %s\n", $fields->{FIELD1}->{FIRSTNAME}, $fields->{FIELD1}-> 
{LASTNAME});


$ perl j.pl
Joe Smith


All done...?

j



More information about the Omaha-pm mailing list