Solved

Problem with Perl Storable under 64bit

Posted on 2010-09-03
8
1,015 Views
Last Modified: 2012-05-10
Hi all,

I have a little problem with Perl under my 64bit machine.
I have saved data under my 32bit server with the perl Storable into a file "file.txt".

Now if I type the command

file file.txt

the shell says:

perl Storable(v0.7) data (major 2) (minor 4)

and if I want to retrieve the file on the 64bit server, there appears the following error:

Byte order is not compatible at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_retrieve.al) line 331, at ./perlbot.pl line 217

It's very important to me that my perl-program runs under 64bit.

I tried to use the compatibility mode in perl ($Storable::interwork_56_64bit = 1) but it doesn't work.

Can I convert the 32bit Storable-File to a 64bit Storable-File, so that my 64bit server can read the file without this error?


Regards,

Peter
0
Comment
Question by:sourceweb
  • 4
  • 3
8 Comments
 
LVL 19

Expert Comment

by:Kim Ryan
ID: 33596109
What version of Perl are you using? See this, http://search.cpan.org/dist/Storable/Storable.pm#64_bit_data_in_perl_5.6.0_and_5.6.1 . I f you use later versions should not be any problem
0
 

Author Comment

by:sourceweb
ID: 33596258
$Storable::interwork_56_64bit = 1 didn't help to solve my problem, but in your URL was written to

"also migrate your data"

but how can I convert a 32bit Storable-File to a 64bit file.
I need the information in this file, I think all I have to do is to change the C header signature

"Hence Storable running on perl with 64 bit integers will read the header from a file written by a 32 bit perl, not realise that the data is actually in a subtly incompatible format, and then go horribly wrong (possibly crashing) if it encountered a stored integer. This is a design failure."

I think I need only to change the binary C header in this file, but I don't know how to change this.
If I use

cat file.txt

at the beginning there are some bits not in ASCII and than comes my data in ASCII.
I think that I need to change only the first few bits in this strorable-file.
0
 
LVL 10

Expert Comment

by:jeromee
ID: 33596490
What did you store in that file?
It might be possible to skip the header and then "parse" the rest to retrieve your data in some fashion.
0
 

Author Comment

by:sourceweb
ID: 33596704
The information in this file is not important, but it's needed by my perl-program.

This perl program must work correctly, I am not allowed to modify it (so that it doesn't use 'retrieve' anymore).

So the perl program needs a correct 64bit storable file, otherwise I have to use 32bit Linux for the next 5 years.


Regards,

Peter
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Accepted Solution

by:
jeromee earned 500 total points
ID: 33596845
Hi Peter,
Maybe I'm missing something but here are the steps I suggested in the other thread:
 * on the 32-bit machine: create a small perl script that runs Storable::retrieve() on the file and save the extracted data using Data::Dumper or some other hardware-agnostic method
 * on the 64-bit machine: instead of using Storable::retrieve() , use Data::Dumper to retrieve the data
 * if using Data::Dumper is too slow, on the write a quick converted from  Data::Dumper  to Storable, so that you can start using Storable again

0
 

Author Comment

by:sourceweb
ID: 33596906
Yes, this should work! Thanks, good idea, so I transfer the data in a 'bit-independent' ;) way and create a new Storable on the 64bit server that's compatible.

I have never worked with Data::Dumper but I think I should find something about that in a perl-doc.

If it works I will close the topic...
0
 
LVL 10

Expert Comment

by:jeromee
ID: 33597172
0
 

Author Closing Comment

by:sourceweb
ID: 33650116
It works... with a little tinkering.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now