Subject: | Error in Docs: Synopsis example code |
I'm using NetServer-Generic-1.03
The example callback code provided in the perldoc Synopsis does not
run.
missing '}' to close while loop
missing semicolon at end of multi-line $server_cb =..... statement
after '}'
So it should read:
my $server_cb = sub {
my ($s) = shift ;
print STDOUT "Echo server: type bye to quit, exit ",
"to kill the server.\n\n" ;
while (defined ($tmp = <STDIN>)) {
return if ($tmp =~ /^bye/i);
$s->quit() if ($tmp =~ /^exit/i);
print STDOUT "You said:>$tmp\n";
} # <---- was missing this close-bracket entirely
}; # <---- was missing semicolon here