Dear fellow Monks,
I've ran into a problem with the Storable module, which looks
like a bug. Whenever I do a "freeze" after a failed "thaw", Storable
will balk with a "bad hash" error coming from within it.
Try the following code, which will work, and then remove the
commented out bad thaw and see if it fails on your setting.
I run this with the latest Storable (1.011) and Perl 5.6:
#!/usr/bin/perl -w
use strict;
use Storable qw(freeze thaw);
my $thaw_me = 'asdasdasdasd';
#eval {
# my $thawed = thaw $thaw_me;
#};
#if($@) {
# warn "there was a THAWING error\n";
#}
my %to_be_frozen = (foo => 'bar');
my $frozen;
eval {
$frozen = freeze \%to_be_frozen;
};
if($@) { die "error while freezing: $@" }
print "it froze it\n";
Thanks in advance for any help on fixing this.
Brother Greg
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.