Re: Maximum length input line
[email protected] (Bryan C . Warnock) Sun, 20 Aug 2000 12:41:27 -0400
| Newsgroups | perl.perl6.language.io |
|---|---|
| Message-ID | <00082012522800.00760@CC789569-A> |
On Sun, 20 Aug 2000, Peter Scott wrote: > Well you guys are way ahead of me on your line discipline modes, so I > didn't want to hazard a syntax; just wanted to make my desires known. I wouldn't say that we are (well, at least me) way ahead. I'm just throwing ideas out nyself, except that I was hazarding a syntax. Someone else was in the process of RFCing line disciplines, so I pretty much just backed off. Particularly because what I know is limited to what I've read, so I'm mainly just wagging this as I go along. > >As in reading the first n columns? > > > >:col=1024 > > > >Read the first 1024 columns of each line, and if the line happens to > >be shorter than 1024, so be it? > > That's what I was looking for, but the other choice I was talking about was > whether the excess is thrown away or comes in on the next read. So there > are these 3 scenarios when a line longer than the user's desired maximum > arrives: > > # No options changed, i.e., current behavior > $line = <FOO>; # $line gets whatever the input was Okay, standard. > > # Maximum input length set to $MAXLEN > # Excess is thrown away > $line = <FOO>; # $length($line) == $MAXLEN > $line = <FOO>; # $line is filled from after last line terminator This would be akin to my :col. (Lay all the lines out, and hack off all the columns past $MAXLEN.) > > # Maximum input length set to $MAXLEN > # Excess left in input buffer > $line = <FOO>; # $length($line) == $MAXLEN > $line = <FOO>; # $line filled starting from next character after previous > $line This would be akin to my :block. (When put on top of, er, under, er, whichever way, the :text discipline to stop at new lines.) -- Bryan C. Warnock ([email protected])