views:

72

answers:

1

How can I make a Perl script think that it is running on 64-bit machine? It needs to perform binary parsing of data that was written on a 64-bit machine, but it needs to be parsed on a 32-bit machine (via argument flag, for example). In my code I using pack/unpack with the formatting 'L!4'.

+1  A: 

If your problem is to be sure that the script works correctly on a 64bit machine, I suggest you use VirtualBox to install a 64bit version of the OS.

See: http://superuser.com/questions/25495/virtual-machine-running-64bit-from-a-32bit-system

But if you need that only to "exploit" the "L!4" mask maybe you should look for a different solution? (e.g.: have you tried to see if your PERL version supports "Q" instead of "L"?)

p.marino