in reply to Storable perl module error?

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!"; }

Replies are listed 'Best First'.
Re: Re: Storable perl module error?
by johnsaunders (Novice) on Apr 27, 2004 at 06:04 UTC
    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...

        tkil, Thanks for your prompt response. I ran your script and it printed "hi mom" on the command line. The script that contains the code I'm using is Movable Type (one of the most popular blogging software used). I'm not really familiar with Perl so I am not sure how to fix it. I've posted questions in the MT support forums and nobody responded. If you wouldn't mind looking at the code of the script that I'm trying to run which is coming up with the error posted above, I have it posted at the DevShed forums at: http://forums.devshed.com/t141992/s.html I used this script on another account on the same server without any problems. It started giving me trouble when I copied all the files over from the old account to the new one. Any help would be greatly appreciated. Thanks, John