Hello dear PerlMonks, I'm trying to match a certain pattern in a DNA sequence and retrieve the position of the match. This wouldn't create a problem, but I don't know how to use the pos() function on an array. I also don't know how to use $- with an unknown amount of matches. This is what I have so far:
@TATA = ($seq =~ m/TATA[A|T][A|T][A|T|G]/i) $number_of_TATA = @TATA; if ($number_of_TATA > 0){ print "The positions of the TATA box are:"; foreach (@TATA){ $TATA_position=pos($TATA)-7; print $TATA_position."\n"; }
I'd greatly appreciate the help! thanks a lot!
In reply to positions of multiple matches by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |