|< 1 2 >| | 12 Einträge, 2 Seiten |
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
open(INPUTFILE,"defs.cfg");
my @fileIn=<INPUTFILE>;
close(INPUTFILE);
my $actPos = 0;
my $delPos = 0;
foreach my $aktIn (@fileIn) {
$actPos++;
if($aktIn =~ /"(.*)","(.*)"/) {
if($1 eq $suchen) {
$matching = "true";
$delPos = $actPos;
splice(@fileIn, $delPos, $delPos, 1);
} else {
if($matching ne "true") {
$matching = "false";
}
}
}
}
@fileIn = grep {!m/^"\Q$suchen\E"/} @fileIn;
1
2
3
4
5
6
7
8
9
10
#! /usr/bin/perl
use strict;
use warnings;
use Tie::File;
my $file = '/path/to/file.txt';
tie my @array,'Tie::File',$file or die $!;
@array = grep{!m/^"\Q$suchen\E"/}@array;
untie @array;
1
2
3
4
5
6
7
8
9
10
11
#! /usr/bin/perl
use strict;
use warnings;
use Tie::File;
my $suchen = 'Test1';
my $file = '/path/to/file.txt';
tie my @array,'Tie::File',$file or die $!;
@array = grep{!m/^"\Q$suchen\E"/}@array;
untie @array;
|< 1 2 >| | 12 Einträge, 2 Seiten |