|Perl Monk, Perl Meditation|
Re^3: 3-byte representation (Simplified!)by BrowserUk (Pope)
|on Oct 13, 2011 at 00:49 UTC||Need Help??|
my $packed = pack '(l<X)*', @array; is more concise, probably faster
That's clever, but does have the limitation that you cannot produce a big-endian stream.
Mind, I don't know if there is any hardware that accepts 24-bit BE values.
A shame there seems to be no way to get rid of the final map on the unpacking side.
Agreed. This isn't the first time that I've wished that pack would allow the insertion of values from the template.
I've also wished for a more generic version of vec that allowed arbitrary numbers of bits, rather than just powers of 2.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.