in reply to find a string and count of its occurence in a text file
"There is a solution for all problems but we need to find a direction"open FH, "inputDatafile.txt"; $/=""; ## input field separator my $line = <FH>; close (FH); $count = $line =~ s/(abc)/$1/g; print "count is : $count\n";
|
|---|