17 Dec
2003
17 Dec
'03
11:17 p.m.
In message <RAA13233.199508282105@garotte.va.pubnix.com>, "Josh M. Osborne" wri tes: [...]
sub syswrite { [...]
So sorry. I gave out the wrong code. Let me try again: sub sysreadln { local($FH) = @_; local($len, $line, $offset) = (0, "", 0); while("\n" ne substr($line, $offset-1, 1)) { $len = sysread($FH, $line, 1, $offset); die "Bad read from $FH: $!" if (!defined($len)); $offset += $len; } return $line; } There. That should help. (yes, this is slow since it asks the OS for a single byte at a time, but in practice it isn't too bad - I use it for small tasks and my multi-stream state-machine monster for the rest)