Hi,
I am running perl 5.8.6 on z/OS unix. I am doing these :
$u = unpack"U0U", "\x8a\x73";
print "\n\$u : $u";
$p = pack("U0U", $u);
print "\n\$p : $p";
This intuitively suggests that $p should be set to the chars \x8a and \x73. But that isnt the case. Instead I get the char \x59.
Alternately,
If I replace \x8a\x73 by \x8E\x4A,
$p is set to \x8E\x4A as expected.
 
In the first case, $u is set to 223 (less than 255)
In the second, $u is set to 329 (>255)
Could this be the reason for the problem ?
 
Also, is there a way to figure out if pack itself has a problem (as in $u is being set to a wrong value) so that unpack results in a different value, or is it that unpack only fails (and pack is working properly?).
 
Any thoughts are welcome.
 
Thanks  in advance,
Rajarshi.


Do you Yahoo!?
Make Yahoo! your home page

Reply via email to