How to read a one line at a time from a gunzip file in perl
I am newbie to perl. I have to write a script that read a file which is in .gz format. The task i have to do is to read line number 1 first which contains a header, extract the field from line one(which is a header of log format and it's gets chang everyday). This extracttion will give me an idea at which numbers (if i am copying in array) the logs of interest will be. After this i want to read one line at a time from .gz file, extract the log at specific spot in an array and copy it in .txt file and later displays in html format.
I just needed help with the reading part of .gz file. Any help is greatly appreciated.
where -I is a varaiable and gets incremented one line at a time till the files end and also they line in logs varied every day. so can not dump the whole file in an array like @ta = `gzcat logtext.20070318.zrc2s0mc.gz|head -2000`;
Please let me know if there is a way i can do this in perl.