You exhaust <> in your first pass. Unfortunately, you can't seek in tty STDIN, so you'll need to invert your logic, making all your comparisons in a single pass of <>. I don't think your range operators will take the same form in that rewrite.
If you mean to iterate over a seekable handle, you'll still probably be better off to only read once.
After Compline,
Zaxo
In reply to Re: Flip flop operator
by Zaxo
in thread Flip flop operator
by sashac88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |