in reply to unbuffered read from socket
Update: If, OTOH, you can't use the buffered ops, then I do think reading one character at a time is your best bet. But you can do better than appending the character with .= each time:my $line = <$filehandle>; chomp $line;
The above requires Perl 5.8 I think. If you don't have that you can use IO::Scalar.my $line; open my $linefh, \$line; until ($char eq "\n") { sysread($filehandle, $char, 1); print $linefh $char; } close $linefh;
Update 2: I noticed that there's a Net::IRC module already out there. Might this work better for you than playing with sockets directly?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: unbuffered read from socket
by eyepopslikeamosquito (Archbishop) on Dec 29, 2004 at 03:42 UTC | |
by Errto (Vicar) on Dec 29, 2004 at 04:02 UTC | |
by eyepopslikeamosquito (Archbishop) on Dec 29, 2004 at 04:35 UTC | |
by Errto (Vicar) on Dec 29, 2004 at 05:03 UTC | |
by Forsaken (Friar) on Dec 29, 2004 at 11:18 UTC | |
|
Re^2: unbuffered read from socket
by Forsaken (Friar) on Dec 29, 2004 at 10:40 UTC |