Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Read a line with max length ?

by cees (Curate)
on Feb 27, 2003 at 03:22 UTC ( #238983=note: print w/replies, xml ) Need Help??


in reply to Read a line with max length ?

perldoc -f sysread

read in your data a piece at a time using sysread, then use index to look for your line breaks so you can split the raw data into lines.

Replies are listed 'Best First'.
Re(2): Read a line with max length ?
by FoxtrotUniform (Prior) on Feb 27, 2003 at 03:27 UTC

    From the Camel (3rd edition), p. 810:

    You should be prepared to handle the problems (like interrupted syscalls) that standard I/O normally handles for you. Because it bypasses standard I/O, do not mix sysread with other kinds of reads, print, printf, write, seek, tell, or eof on the same filehandle unless you are into heavy wizardry (and/or pain).

    Why sysread over read?

    --
    F o x t r o t U n i f o r m
    Found a typo in this node? /msg me
    The hell with paco, vote for Erudil!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2019-10-16 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?