in reply to Modification of read only values.

You cannot modify number variables. Make a copy first:
while ($text =~ m/(TATAAT|TTGACAT)\w+[^ATG]?(ATG\w+)[^TAG|TAA|TGA]?/g) + { my $match = $2; $match =~ tr/ATGC/UACG/; print $match; }