#!perl -nw BEGIN{ $i=0; $r{A}=$i++; $r{C}=$i++; $r{G}=$i++; $r{U}=$i++; } $s=""; $i=0; for(split//){ vec($s,$i++,2)=$r{$_} } print$s