in reply to case sensitive addition

Nathan_84,
The answer to your question is to read perlre and see that the /i modifier makes the regex case insensitive. The thing is, the code has a lot more that could be improved then just the case sensitivity. For instance, you are using a bare word file handle, have a variable $cnt that you don't use and are slurping the entire file into memory.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: case sensitive addition
by murugaperumal (Sexton) on May 14, 2010 at 04:18 UTC
      Use the following code to match the case insensitive. 
    
    if($line=~/$pattern/i) { $found++ }
      Hi thanks for the reply.
      I must be inputting the code you gave me in the wrong place. Please can you say where exactly I should insert this.
      Thanks