diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-11-06 10:45:11 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-11-06 10:45:11 +0100 |
| commit | fda71812015962aff98388cdc2ad59ea1104aa70 (patch) | |
| tree | 01d5a11cbd5770d25d7416f22a46c93ffcc4e0d9 /Aufgabe3 | |
| parent | a28373665a3cfa42d21462b92244697e6f8f0a7d (diff) | |
| download | Skriptsprachen-fda71812015962aff98388cdc2ad59ea1104aa70.tar.gz Skriptsprachen-fda71812015962aff98388cdc2ad59ea1104aa70.zip | |
Remove new line from german and pipe directly
Diffstat (limited to 'Aufgabe3')
| -rw-r--r-- | Aufgabe3/skript3.pl | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Aufgabe3/skript3.pl b/Aufgabe3/skript3.pl index 68ed536..3cc642d 100644 --- a/Aufgabe3/skript3.pl +++ b/Aufgabe3/skript3.pl @@ -49,24 +49,22 @@ my %german; while (my $line = <$germanFile>) { + chomp $line; $german{uc $line} = 0; } close $germanFile or warn "$0 : failed to close input file '$german_file_name' : $!\n"; -my @loesung; - while (my $line = <$INPUTPIPE>) { + chomp $line; if (exists $german{uc $line}) { - push @loesung, uc $line; + printf $OUTPUTPIPE "%s\n", uc $line; } } -print $OUTPUTPIPE @loesung; - close $OUTPUTPIPE or warn "$0 : failed to close pipe > $OUTPUTPIPE_command < : $!\n"; close $INPUTPIPE |
