![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/perl
use strict;
use warnings;
my $lastmatch = 0;
while (<>) {
my $match = m~ROT~;
print if $match or $lastmatch;
$lastmatch = $match;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
use strict;
use warnings;
my @rot;
my @vio;
my $lastmatchrot = 0;
my $lastmatchvio = 0;
while (<>) {
my $matchrot = m~ROT~;
my $matchvio = m~VIO~;
push @rot, $_ if $matchrot or $lastmatchrot;
push @vio, $_ if $matchvio or $lastmatchvio;
$lastmatchrot = $matchrot;
$lastmatchvio = $matchvio;
}
my $fh;
open ($fh, ">Ausgabedatei.txt") or die "Kann Ausgabedatei nicht öffnen: $!";
print $fh "ROT:\n";
print $fh $_ for @rot;
print $fh "\nVIO:\n";
print $fh $_ for @vio;
close ($fh) or die "Kann Ausgabedatei nicht schließen: $!";
![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |