5 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
print $client "Command? ";
while ( <$client> ) {
next unless /\S/; # blank line
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;
}
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;
}
}
if (exists $command{$_}) {
5 Einträge, 1 Seite |