[Pdx-pm] bit conversion brain-teaser

Tkil tkil at scrye.com
Tue Mar 4 00:48:14 CST 2003

>>>>> "Randal" == Randal L Schwartz <merlyn at stonehenge.com> writes:

Randal> perl -le 'print unpack "B*", pack "H*", "3F";'
Randal> =>
Randal> 00111111

Am I the only person who finds the "H" template to be "backwards" to
some extent?  I guess I could remember that I'm "packing" two nybbles
into one byte, but I can't get over the fact that "pack 'H*'" is
"decoding" something, which I mentally assign to be "unpack"'s job.

And if that made no sense, then it just means that I need to drink
more before posting.


More information about the Pdx-pm-list mailing list