in reply to Unpack Fail to Decompress String?

You don't need to make a bitstring. Replace input, chunks at a time.

my %chunkmap = map { $_ => pack "b*", @charmap{split //,$_} } map { glob } map { ("{A,C,G,T}" x $_) . ("A"x(4-$_)) } 1..4; $string =~ s/(.{1,4})/$chunkmap{$1}/g;

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊