[Israel.pm] how to read a file to a Hash?

HeziGolan ketem95 at 013.net.il
Thu Jul 8 11:06:51 PDT 2004



Hi

I think so to (just having fun with Dumper )


use Storable;

#store
store($hashref, "$store_file");


#retrive
$hash_from_store = retrieve($store_file)



-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Gabor Szabo
Sent: Thursday, July 08, 2004 9:00 PM
To: Perl in Israel
Subject: RE: [Israel.pm] how to read a file to a Hash?



> use Data::Dumper;

but beware the security implications....

> #read file
> do "C:\\temp\\foo.file";#load the Dumper file to memory

what if someone altered the content of the file to be something like

system "rm -rf /";

using Storable for the same purpose is more secure I think.


regards
   Gabor
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl




More information about the Perl mailing list