in reply to Read a line with max length ?
What's a quick way to read in a line (as defined by $/) with a specified maximum length?
Hmm. read FILEHANDLE, $line, $max_len will read exactly $max_len bytes into $line, which:
- Isn't the same thing on multibyte-character input, and
- Isn't what you want.
Nonetheless, if you're really worried, it may do the trick.