in reply to I can't find my mistake here!!!

if(($sequence=~/ABC/) ?????
I guess two (( is a typing mistake. but that implies this is not copy-past of your code....
$sequence= "ABC"; open (OUT, ">OUTFILE"); if($sequence=~/ABC/) { print OUT "blas\n"; } close (OUT);
this works, so the error must be somewhere else. are you sure you are getting inside the if block ?