I am new to perl and find difficulty in optimising my code.I have many .gz files and I need to search a pattern in them and return the total number of lines matching the pattern.
In bash I can use
In perl there is fgrep but it wont work on .gz files.Either I have to uncompress the files and use fgrep or read the compressed files using Compress::Zlib module and check for the pattern.Both are taking very long time(3 times the time taken by zgrep) as I am working on many large gz files . Is there any way of doing this???
Thanks in Advance.