Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Splitting a file based on matched conditions

by Anonymous Monk
on Sep 19, 2017 at 13:02 UTC ( #1199668=note: print w/replies, xml ) Need Help??

in reply to Splitting a file based on matched conditions

To read "the last line" of any file, seek() to a position relative to the end-of-file, that you know is far-enough back to encompass the last few lines, then start reading. (If the file might be UTF-8 then you need to be prepared to ignore UTF-8 errors on the off-chance that your seek put you smack in the middle of a multibyte sequence.) You really want to be sure that you read more-than-one line in this way so as to be very certain that the last line you read is complete.
  • Comment on Re: Splitting a file based on matched conditions

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199668]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-03-24 12:48 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (298 votes). Check out past polls.