Leser: 2
10 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper qw/Dumper/;
use WWW::LEO;
while (1) {
print "Word: ";
chomp(my $text = <STDIN>);
last if ($text eq 'q');
translate($text);
}
sub translate {
my $text = shift;
my $leo = WWW::LEO->new();
$leo->query($text);
if ($leo->num_results) {
print Dumper $leo->en_de();
} else {
print "Sorry, your query for '%s'gave no results.\n", $leo->query;}
print "$leo\n";
}
1
2
3
4
5
6
7
8
Use of uninitialized value in string eq at J:/Programme/Perl/site/lib/WWW/LEO.pm
line 203, <STDIN> line 1.
Use of uninitialized value in string eq at J:/Programme/Perl/site/lib/WWW/LEO.pm
line 205, <STDIN> line 1.
Use of uninitialized value in string eq at J:/Programme/Perl/site/lib/WWW/LEO.pm
line 203, <STDIN> line 1.
Use of uninitialized value in string eq at J:/Programme/Perl/site/lib/WWW/LEO.pm
line 205, <STDIN> line 1.
while ( 1 ) { ... }
1
2
3
4
5
6
while (1) {
print "Word: ";
chomp(my $text = <STDIN>);
last if ($text eq 'q');
translate($text);
}
1
2
3
4
5
6
7
8
9
10
11
translate('Eimer');
sub translate {
my $text = shift;
my $leo = WWW::LEO->new();
$leo->query($text);
if ($leo->num_results) {
print Dumper $leo->en_de();
} else {
print "Sorry, your query for '%s'gave no results.\n", $leo->query;}
print "$leo\n";
}
10 Einträge, 1 Seite |