[Omaha.pm] Search and replace

Andy Lester andy at petdance.com
Thu Sep 4 11:14:10 PDT 2008


On Sep 4, 2008, at 12:50 PM, Jay Hannah wrote:

>
>       search_string=  att            ATT
>       seq=            gaattcacccgat  GAATTCACCCGAT
>       result=         gaATTcacccgat  GAattCACCCGAT


Roughly this:

$seq =~ s/($search_string)/translate($1)/e;

sub translate {
     $_[0] =~ tr/A-Z/a-z/;
     return $_[0];
}

That should work, although there may be a slick way to do it w/o the  
func call.

--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance





More information about the Omaha-pm mailing list