K
Kim Schulz
Hi I'm working on doing a bit of simple compression of some datafiles I
have.
Right now I have files like:
1 2 5 4 3 23 6 5 34 455 6 3 22 1 1 1 22 .... etc.
I would like to read the numbers one by one (no problem) and then pack
them into the smalles binary representation I can get.
The idea is that I later on would like to be able to unpack them again.
I have been looking at pack/unpack and tried pack("b*", $num) where
$num is one of the numbers "represented as a string".
That seems to pack it fine, but then I want to unpack it again.
And cant seem to get that one working like it is supposed to.
Can anyone point me in the right direction? (yes I have looked at the
perldoc for unpack and pack but what I understood to be correct does
not work).
have.
Right now I have files like:
1 2 5 4 3 23 6 5 34 455 6 3 22 1 1 1 22 .... etc.
I would like to read the numbers one by one (no problem) and then pack
them into the smalles binary representation I can get.
The idea is that I later on would like to be able to unpack them again.
I have been looking at pack/unpack and tried pack("b*", $num) where
$num is one of the numbers "represented as a string".
That seems to pack it fine, but then I want to unpack it again.
And cant seem to get that one working like it is supposed to.
Can anyone point me in the right direction? (yes I have looked at the
perldoc for unpack and pack but what I understood to be correct does
not work).