I think you meant to reply to Joe Smith's post?
No, though certainly I was not meaning to correct yours, just
making relations that I felt the OP would not have recognised
otherwise, but might nonetheless have been interested to see.
Specifically, you were making use of the various facilities that
Perl includes for the sake of one liners, my intention was to
translate that into the nearest equivalent one liner.
By the way, why are you using the -a switch which splits the line into
the @F array when you are not using the @F array, and why are you using
the -l switch which removes the newline and then adds it back in when
the line is printed?
Gah.
Well, I guess -l does the right thing, albeit pointlessly. -a is quite
useless in this context, and I can only put it down to habit. I seem to
always read logfiles with a comand that starts "perl -lane ..." and in
this context I am usually doing something useful with @F and the removal
of the newline if not important but adding it back is.
*running and hiding*
--Damian