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
29
30
31
32
33
my $EMPTYname = "EMPTY";
my @dataEempty = ();
open (Boundary, "<",boundary);
@dataEempty = <Boundary>;
close (Boundary);
foreach $lineEmpty(@dataEempty)
{
if($lineEmpty eq $EMPTYname)
{
print "Es wird gelöscht: = $lineEmpty \n";
push @output,$lineEmpty;
}
else
{
print "Nicht gelöscht: = $lineEmpty \n";
push @outputNonEmpty,$lineEmpty;
}
}
system("rm boundary");
open(OUT,">boundary");
foreach $line(@outputNonEmpty)
{
print OUT $line;
};
close(OUT);
2012-02-20T15:19:00 donlenardoCode: (dl )1
2
3
4
5my $EMPTYname = "EMPTY";
.............
foreach $lineEmpty(@dataEempty)
{
if($lineEmpty eq $EMPTYname)
if($lineEmpty =~ /^ *$EMPTYname$/)
if($lineEmpty =~ /$EMPTYname/)
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#!/usr/bin/perl use strict; use 5.010; use warnings; my $EMPTYname = "EMPTY"; my ( @dataEempty, @output ); open BOUNDARY, "< /home/wolf/Dokumente/emty.txt"; @dataEempty = <BOUNDARY>; close BOUNDARY; foreach ( @dataEempty ) { my $lineEmpty = shift @dataEempty; unless ( $lineEmpty =~ /$EMPTYname/ ) { &schreibe ( $lineEmpty, \@output ) } else { &schreibe ( $lineEmpty, \@output ); last } } my $weiter = 0; foreach my $lineEmpty(@dataEempty) { if ( $lineEmpty =~ /\}/ ) { &schreibe ( $lineEmpty, \@output ); $weiter = 1 # Umschalter } else { &schreibe ( $lineEmpty, \@output ) if $weiter == 1 } } open OUT, "> /home/wolf/Dokumente/boundary"; foreach my $line (@output) { print OUT $line } close OUT; sub schreibe { my ($lineEmpty, $ar) = shift; print "Es wird geschrieben: = $lineEmpty \n"; push @$ar, $lineEmpty }
2012-02-20T20:46:26 hugenyn
Quote$lineEmpty =~ /$EMPTYname/
Quote$lineEmpty =~ /\}/