Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Safely reading line by line

by martin (Friar)
on Jun 28, 2007 at 22:22 UTC ( #623996=note: print w/replies, xml ) Need Help??


in reply to Safely reading line by line

In order to survive malformed input while keeping the normal procedure line-oriented, I need perhaps a getline variant with some sort of length limitation. I'd like to be able to give up gracefully when excessively long lines are detected.

It turns out getline is not a trivial target to emulate, what with all those variants of $INPUT_RECORD_SEPARATOR. I have tried to prove the concept here, but with good chances to win an ugliness contest.

Should Perl perhaps offer native support for such a feature?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://623996]
help
Chatterbox?
[holli]: i just keep spamming
[holli]: writing a cb client in operl 6
[LanX]: operl?
[LanX]: 😅
[holli]: typo

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2017-09-23 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (272 votes). Check out past polls.

    Notices?