# "$ _" is really "$_", and change the qq to a double-quote $_ = "CG T--A A---T A----T C----G T----A A---T and so on "; @_{A => C => G => T => } = 0..3; s|.*(\w).*(\w).*\n|$_{$-++ / 9 % 2 ? $2:$ 1}|gex; s|(.)(.)(.)(.)|chr (64*$1 + 16*$2 + 4*$3 + $4)|gex; eval