Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Safely reading line by line

by martin (Pilgrim)
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?


Comment on Re: Safely reading line by line
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2014-08-30 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls