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: Intermediate:
Pack/Unpack not matching

 



Sten
New User

Jul 28, 2005, 7:46 AM

Post #1 of 2 (279 views)
Pack/Unpack not matching Can't Post

I have the following code to pack data, when I unpack it to see if I got it back fine, it is actualy wrong:


Code
 my @record = ($dlen, $mlen, $rlen, $fdiv, @dur_keys, @main, @repeat); 

print join(" ", @record), "\n";
$buff = pack("C3S5C*", @record);

my @bk = unpack("C3S5C*", $buff);
print join(" ", @bk);



An example of the result is the following:

4 0 6 318 3 3190 2166 6932 1 2 2 2 2 3
4 0 6 318 3 3190 2166 6932 0 1 2 2 2 2 3 0

Anyone knows what the problem is?


Thanks


Sten


Sten
New User

Jul 28, 2005, 12:31 PM

Post #2 of 2 (276 views)
Re: [Sten] Pack/Unpack not matching [In reply to] Can't Post

Found the problem and, as I suspected, had nothing to do with unpack. Thanks for looking anyway.

 
 


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

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