CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
unpack incompatability in version 5.8.8

 



davezx
New User

Feb 3, 2011, 4:54 PM

Post #1 of 2 (2321 views)
unpack incompatability in version 5.8.8 Can't Post

I downloaded a perl program from someone, but perl 5.8.8 didn't support this statement:

my ($cl,$h,$l,$o,$v,$t) = unpack("x$off f> f> f> f> f> H16", $data);

The error returned was:

Invalid type '>' in unpack at pricehist.pl line 77.

Is there another to accomplish this statement with an earlier version of perl. I don't want to upgrade because I have hundreds of scripts that I'm afraid may not be compatable.

Thanks in advance!

David


budman
User

Feb 9, 2011, 7:55 PM

Post #2 of 2 (2110 views)
Re: [davezx] unpack incompatability in version 5.8.8 [In reply to] Can't Post


In Reply To
my ($cl,$h,$l,$o,$v,$t) = unpack("x$off f> f> f> f> f> H16", $data);

The error returned was:
Invalid type '>' in unpack at pricehist.pl line 77.

Is there another to accomplish this statement with an earlier version of perl. I don't want to upgrade because I have hundreds of scripts that I'm afraid may not be compatable.


I havent looked at pack/unpack for a while. The f> means float big-endian. "Byte-order modifiers" were recently introduced in perl 5.9. To run in 5.8 you may need to change f> to F for big-endian.

Check the perl docs on pack/unpack.
http://perldoc.perl.org/perlpacktut.html#Packing-and-Unpacking-C-Structures

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives