http://www.perlmonks.org?node_id=586880


in reply to Re: print log file
in thread print log file

hmm first: seek is byte oriented not line oriented. As far as i understood it he needs one line at a time. This isnt much of a problem when you have a file with fixed length lines but since we are talking about a logfile this is doubtful (although possible). So while seek is probably the fastest way to move around a file i'm afraid you cant use it here.

--
"WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
-- Terry Pratchett, "Reaper Man"

Replies are listed 'Best First'.
Re^3: print log file
by BerntB (Deacon) on Nov 30, 2006 at 06:52 UTC
    That is why the do_test routine skipped the first line it read. It said:

    # Has moved somewhere in file. Skip partial line of log: <FILE>;
    This just attempts to make the log traversal smaller, not perfect. (Wouldn't be so hard either, of course. But I'm out the door in a few minutes. :-)
      ok i withdraw ;) still too early here should get more caffeine in the bloodstream before writing posts.

      --
      "WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
      -- Terry Pratchett, "Reaper Man"