in reply to Re: Count word in my dir
in thread Count word in my dir

That's just not correct.
#!/usr/bin/perl -w use strict; foreach ("WORDHERE", "stuffthenWORDHERE", "WORDHEREthenstuff", "stuffbeforeWORDHEREstuffafter", "wordhere", "no_word_here") { print "$_: "; if($_ =~ /WORDHERE/gi) { print "matches"; } else { print "doesn't match"; } print "\n"; }
produces
WORDHERE: matches
stuffthenWORDHERE: matches
WORDHEREthenstuff: matches
stuffbeforeWORDHEREstuffafter: matches
wordhere: matches
no_word_here: doesn't match