#!/usr/bin/perl -w use strict; my $str = 'atcgcgtacatcgatac'; substr($str,8,1)= uc (substr($str,8,1)); #substr($str,-9,1)= uc (substr($str,-9,1)); #coincidence that this is same print $str; #prints atcgcgtaCatcgatac