#!/usr/bin/perl use warnings; use strict; open (FILE,"sequence.txt"); my $substring = 'GATC'; my$i=0; my$count; my $sequence; while ($sequence=){ foreach($sequence =~ /$substring/) { #print "malakas\n"; #print "$count\n"; } $count++; } print "There are $count negative numbers in the string";