line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PerlIO::via::LAUTER_DEUTSCHER; |
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
522
|
use Lingua::Translate; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Carp; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $fish; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
|
|
|
|
|
|
$fish = Lingua::Translate->new( src => 'en', dest => 'de' ) |
14
|
|
|
|
|
|
|
or croak 'unable to translate from en to de'; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub unimport { |
18
|
|
|
|
|
|
|
undef $fish; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub PUSHED { |
22
|
|
|
|
|
|
|
my $self = ''; |
23
|
|
|
|
|
|
|
bless \$self, shift; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub FILL { |
27
|
|
|
|
|
|
|
my ( $self, $fh ) = @_; |
28
|
|
|
|
|
|
|
return defined $fh ? $self->_translate(<$fh>) : undef; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub WRITE { |
32
|
|
|
|
|
|
|
my ( $self, $text, $fh ) = @_; |
33
|
|
|
|
|
|
|
return 0 unless defined $text; |
34
|
|
|
|
|
|
|
if ( my $out = $self->_translate($text) ) { |
35
|
|
|
|
|
|
|
print $fh $out; |
36
|
|
|
|
|
|
|
return length $out; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else { |
39
|
|
|
|
|
|
|
return -1; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _translate { |
44
|
|
|
|
|
|
|
my ( $self, $line ) = @_; |
45
|
|
|
|
|
|
|
return if not ref $fish; |
46
|
|
|
|
|
|
|
return if not defined $line or $line !~ /\w/; |
47
|
|
|
|
|
|
|
my $out = uc $fish->translate($line); |
48
|
|
|
|
|
|
|
for ($out) { |
49
|
|
|
|
|
|
|
s/ \b TIMMY \b /DIETER/gsx; # a solid German name |
50
|
|
|
|
|
|
|
s/ (?<=\w) \. (?=\W|\Z) /!/gsx; # there's no whispering! |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
chomp $out; |
53
|
|
|
|
|
|
|
return "$out\n"; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |