Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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?

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-11-25 14:00 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (677 votes), past polls