At first I thought this was a -io item, but then I realized the -io part is
easy; it's the -language part I need to get right :-)
I have often thought that there should be a way to say that a readline()
should limit the length of line it could return, or in circumstances where
the input source could be malicious there could be a DoS attack with a huge
stream of characters absent any newlines.
I.e., if my code does $foo = <FILE> and the user feeds 10 terabytes of
characters to the filehandle without a newline, the program would have
problems. I presume; I've never tried it :-)
I discovered the $/ = ref_to_integer feature and thought, "Ah, this is
it." But not quite - on non-record-oriented systems (e.g., Unix), a
getline will now read exactly that many characters in, including a newline
and the next record, and the next... In other words, it looks just like
read().
Would really like a feature that said, "<> will get characters until this
many have been retrieved, or newline, whichever comes first." Sound
reasonable?
--
Peter Scott
Pacific Systems Design Technologies