in reply to Re: Count word in my dir
in thread Count word in my dir
produces#!/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"; }
WORDHERE: matches stuffthenWORDHERE: matches WORDHEREthenstuff: matches stuffbeforeWORDHEREstuffafter: matches wordhere: matches no_word_here: doesn't match
|
|---|