|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Looking for a string from a huge log fileby pvaldes (Hermit) |
| on Sep 13, 2012 at 21:08 UTC ( #993579=note: print w/ replies, xml ) | Need Help?? |
|
Not my intention to be rude, but delete this script, think a little in what do you want to do and try again. Seriously, is very poor. For example: You claim to have a big file, Well, you are chomping each same line of this huge file up to three times. So your script is very bussy... doing nothing. If you need to delete a special input separator redefine $/ Don't apply four lines of regex if you want to delete a line containing "my pattern". Use "grep-not" (grep !/my pattern/, FH) instead. keeps on printing the same string for all the other ID'sbecause $_ is not changing at all in the last lines. The loop has finished when you print to outfile so you only have the last matched line of your log in $_. can you explain a little what do you need to do? while(<MYINPUTFIL3>){Try to keep it simple and readable, filehandles don't need to be complicated: while(<LOG>){
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||