johnsaunders has asked for the wisdom of the Perl Monks concerning the following question:

I've been searching all over on how to fix this and could not dig anything up. Whenever I run a script, I receive the following error. I know that the data file is corrupted and I was wondering if anyone knows how to fix this.
/usr/bin/perl /home/login/public_html/mt/mt-rebuild.pl -mode="index" - +blog_id="1" -template="Netflix Queue" /home/login/public_html/mt/plugins/netflix-history.pl did not return a + true value at /home/login/public_html/mt/lib/MT.pm line 117. Corrupted storable string (binary v2.4) at blib/lib/Storable.pm (autos +plit into blib/lib/auto/Storable/thaw.al) line 369, at /home/login/pu +blic_html/mt/lib/MT/PluginData.pm line 28 Compilation failed in require at /home/login/public_html/mt/lib/MT.pm +line 117.
Here's the code that is causing the error (second to last line):
sub data { my $data = shift; $data->column('data', freeze(shift)) if @_; thaw($data->column('data')); }
Any help would be greatly appreciated.

Replies are listed 'Best First'.
Re: Storable perl module error?
by tkil (Monk) on Apr 24, 2004 at 05:50 UTC

    Without knowing anything more about your installation (which might in fact be broken), my best guess is that your column method on $data is not binary-clean.

    You can test to see if freeze and thaw are working with a small one-liner:

    $ perl -MStorable=freeze,thaw \ -lwe 'print ${ thaw freeze \"hi mom" }' hi mom

    You can also test your column method more specifically, something like this:

    use bytes; my $orig = join '', map chr($_), 0 .. 255; $data->column( 'data', $orig ); my $new = $data->column( 'data' ); if ( $orig ne $new ) { die "method 'column' is not binary clean!"; }
      Thanks for your response. I tried using your test scripts in seperate files (the shebang line along with your code) and this is what came up:
      server# perl perl.cgi Backslash found where operator expected at perl.cgi line 3, near "thaw + \" (Do you need to predeclare thaw?) String found where operator expected at perl.cgi line 4, near "lwe 'pr +int ${ thaw freeze \"hi mom" }'" (Do you need to predeclare lwe?) Semicolon seems to be missing at perl.cgi line 4. Can't modify subtraction (-) in scalar assignment at perl.cgi line 3, +near "freeze," syntax error at perl.cgi line 3, near "thaw \" Execution of perl.cgi aborted due to compilation errors.
      server# perl perl.pl Can't call method "column" on an undefined value at perl.pl line 5.
      Do you have any idea why it isn't working? John

        Note that my first example was intended to be run from a (unix-like) command prompt. A stand-alone perl script that does the same test would be something like this:

        #!/usr/bin/perl use strict; use warnings; use Storable qw( freeze thaw ); print ${ thaw freeze \"hi mom\n" }; exit 0;

        If this runs without errors, then it again looks like your column method is suspect...