I'm trying to do some persistence, and Data::Dumper seems like a popular tool, so that's what I'm trying to use.
I'm using LWP::Simple to grab web pages, and then I create a hash with a few tidbits about the web page and a copy of the text from the web page. I'd like to stash that hash away somewhere. I've tried playing around with Data::Dumper, but it's giving me a headache.
$hash_ref->{name} = 'a page'; $hash_ref->{time_to_download} = '3.23453'; $hash_ref->{content} = $content; # from LWP::Simple get my $dumped = Dumper($hash_ref); print $a_file $dumped;
I've tried setting Data::Dumper::Pure and Data::Dumper::Terse.
Then there's the problem of eval'ing this thing later. I don't want to eval the entire text of a web page. Maybe the text is 'system("rm -r $HOME")', or however you'd actually format that.
Thanks... gotta run.. another $%^#$^ fire alarm
-Pileofrogs
Update: Thanks! I'll go check out those other modules!
Another Update: YAML looks perfect! I especially like the 'taint safe' aspect.
Final Update: YAML solved my problem. I also used MIME::base64 to encode the content from LWP::Simple before YAML'ing it. That was a big performance boost.
In reply to Data::Dumper for a Dummy by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |