for (split //, '4B') { $_ = unpack 'B8'; s/^.//; $out .= $_; }