in reply to how to open all file one by one

Are you sure you need perl for this? It sounds like all you need is the unix/linux/macosx "grep" utility (available for windows - just google "ms-windows grep")
grep critical *.txt
That will show you every line from every *.txt file that contains the word "critical". If all you want is the list of file names, use the "-l" option:
grep -l critical *.txt
If there's more you want to do, perl might be useful for that (or there might be another unix/linux/osx tool that does what you want...)

Replies are listed 'Best First'.
Re^2: how to open all file one by one (ack)
by Anonymous Monk on Apr 12, 2013 at 03:36 UTC
    :)ack is a perl replacement for grep
      it looked like a bit difference. I want to know how to open every file and scan inside the file word which if detect "critical :xxxxx" then will send out this file for the admin.