http://www.perlmonks.org?node_id=605378


in reply to 5x6-bit values into/out of a 32-bit word

I'd use a 4 Byte String and vec.

Update: Sorry... Didn't notice that vec is just for powers of 2 :-(

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e