Your substitution operates on the contents of the $_ variable, but then you never do anything with that (potentially) modified variable. Did you not show a complete code example? I expected to see a print somewhere.
I was missing the file handler to write to the file and I got it resolved. But now my script works only on old logs. I want to do something with my current log file that are running 24/7.
I want not to search from the top of the file again if I already did 2 hours a go, any ideas?