There's more than one way to do things | |
PerlMonks |
Re: perl pack/unpack optional variable length databy Anonymous Monk |
on Dec 18, 2015 at 08:24 UTC ( [id://1150677]=note: print w/replies, xml ) | Need Help?? |
How do I use unpack in this case? In what case? You use too many words in the description but its still too vague solution is simple, don't read more bytes than you can process
now if $value needs to be unpacked further, or you need to guess how many more bytes to read into $buffer, or .... If the protocol/format doesn't follow length/value pattern, the docs must specify what pattern it follows, there must be a pattern, an assumption the original program that produced these bytes followed ... just gotta find out what it is For example Declaring Hash entries
In Section
Seekers of Perl Wisdom
|
|