
waltz
Novice
Oct 5, 2011, 5:53 AM
Post #1 of 2
(592 views)
|
|
Unpack - bad result (from file)
|
Can't Post
|
|
Hi, what is wrong on code bellow ? ...on output i except three number - no only one :( can youi help me ?
open I, ">d:\\a.bin"; binmode I; print I pack('i3', 444, 555, 666); # three integers close I; # read open O, "d:\\a.bin"; binmode I; while (read(O, $b, 12) != 0) { # one integer has 4 bytes (4*3 as one block of three integers) print unpack('i3', $b) . "\n"; # ??? } close O; Thank you
|