S
Steuard Jensen
Some time ago, I wrote a perl script that uses the Storable module to
save long term data. The script itself runs fine (or at least, its
bugs aren't important here).
My problem is that the server where I run the script recently crashed.
It has been replaced by a new machine with a different architecture
(the dead server was an Alpha 21164a, the new one is a dual AMD
Opteron, both running Linux, I believe), and quite possibly a newer
version of perl (the current version is 5.8.3).
I still have my old Storable data files, but they were created using
"store" rather than the platform-independent "nstore". (I did not
anticipate this sudden need to change platforms!) So now when I try
to run my script, I get the message
"Byte order is not compatible at ../../lib/Storable.pm (autosplit
into ../../lib/auto/Storable/_retrieve.al) line 323"
(For the curious, line 323 is where Storable.pm calls its internal C
routine to read a file.)
All was not yet lost: the man page for Storable explains that earlier
versions of Storable used a different header format that caused
problems on some 64 bit platforms. It claims that this problem can
lead to an error message like that above, and goes on to say that
"If you have such data then you you should set
$Storable::interwork_56_64bit to a true value to make
this Storable read and write files with the old header."
I tried writing a little script using that setting to convert the old
files into the platform independent format (I'll include it at the
end). But even though I set the "interwork_56_64bit" variable to
true, I still get the same error message as before.
So my question is, is my data lost for good? Would I need to find
another Alpha running perl 5.6 in order to convert it into a platform
independent format? Is there some handy conversion script out there
to do the job for me? I'm willing to do a bit of work to fix things,
but this isn't important enough for me to spend time digging through
Storable's C code or learning the intricacies of endian-ness to fix
it. Thanks in advance for any advice you can give.
Steuard Jensen
My non-working conversion script:
============================================================
use Storable qw(nstore retrieve);
$Storable::interwork_56_64bit = 1;
my $storefile = shift(@ARGV);
my $data = retrieve($storefile);
$Storable::interwork_56_64bit = 0;
nstore($data, $storefile . ".new");
============================================================
(Setting the "interwork" variable back to false probably isn't
necessary since I'm using nstore, but I decided not to take chances.)
save long term data. The script itself runs fine (or at least, its
bugs aren't important here).
My problem is that the server where I run the script recently crashed.
It has been replaced by a new machine with a different architecture
(the dead server was an Alpha 21164a, the new one is a dual AMD
Opteron, both running Linux, I believe), and quite possibly a newer
version of perl (the current version is 5.8.3).
I still have my old Storable data files, but they were created using
"store" rather than the platform-independent "nstore". (I did not
anticipate this sudden need to change platforms!) So now when I try
to run my script, I get the message
"Byte order is not compatible at ../../lib/Storable.pm (autosplit
into ../../lib/auto/Storable/_retrieve.al) line 323"
(For the curious, line 323 is where Storable.pm calls its internal C
routine to read a file.)
All was not yet lost: the man page for Storable explains that earlier
versions of Storable used a different header format that caused
problems on some 64 bit platforms. It claims that this problem can
lead to an error message like that above, and goes on to say that
"If you have such data then you you should set
$Storable::interwork_56_64bit to a true value to make
this Storable read and write files with the old header."
I tried writing a little script using that setting to convert the old
files into the platform independent format (I'll include it at the
end). But even though I set the "interwork_56_64bit" variable to
true, I still get the same error message as before.
So my question is, is my data lost for good? Would I need to find
another Alpha running perl 5.6 in order to convert it into a platform
independent format? Is there some handy conversion script out there
to do the job for me? I'm willing to do a bit of work to fix things,
but this isn't important enough for me to spend time digging through
Storable's C code or learning the intricacies of endian-ness to fix
it. Thanks in advance for any advice you can give.
Steuard Jensen
My non-working conversion script:
============================================================
use Storable qw(nstore retrieve);
$Storable::interwork_56_64bit = 1;
my $storefile = shift(@ARGV);
my $data = retrieve($storefile);
$Storable::interwork_56_64bit = 0;
nstore($data, $storefile . ".new");
============================================================
(Setting the "interwork" variable back to false probably isn't
necessary since I'm using nstore, but I decided not to take chances.)