Much more elegant! Just a note that you can't set this on a per file handle basis so the calling syntax (that avoids warnings) is as shown below.
use IO::Socket; $|++; IO::Handle->input_record_separator('END'); my $sock = new IO::Socket::INET( LocalHost => 'localhost', LocalPort => 1234, Proto => 'tcp', Listen => SOMAXCONN, Reuse => 1 ) or die "no socket :$!"; while ($new_sock = $sock->accept()) { while ( defined( my $line = $new_sock->getline) ) { print "Got: $line\n"; } }
In reply to Re^2: Socket IO NO new line
by tachyon-II
in thread Socket IO NO new line
by indigo1tx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |