Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Looking for a string from a huge log file

by pvaldes (Chaplain)
on Sep 13, 2012 at 21:08 UTC ( #993579=note: print w/ replies, xml ) Need Help??

in reply to Looking for a string from a huge log file

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's

because $_ 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?


Try to keep it simple and readable, filehandles don't need to be complicated:


Comment on Re: Looking for a string from a huge log file

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993579]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2015-11-28 05:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (737 votes), past polls