1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
while ( <$client> ) {
next unless /\S/; # blank line
chomp;
my %commands = (
'quit' => sub { $exit = 1; last; },
'title' => \&title,
'next' => \&next_title,
'prev' => \&prev_title,
);
if ( defined( $commands{$_} ) ) {
$commands{$_}->();
} else {
print $client "Commands: quit title prev next", $CRLF;
}
}
\n\n
<!--EDIT|esskar|1105311104-->