open(FILENAME,"c:\\abc.txt") || die "Cannot Open the file.\n" ; my $quote_count = 0 ; my $pos = 0 ; my $record = "" ; while() { $record = $_ ; chomp $record ; while ($pos = index($record, '"', $pos) != -1) { $quote_count++; $pos++; } } print "Number of double quotes are $quote_count\n"; close FILENAME ;