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.