[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Search and replace




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@petdance.com => www.petdance.com => AIM:petdance