|< 1 2 3 4 5 >| | 47 Einträge, 5 Seiten |
1
2
3
4
my $file = "xyz.txt";
unless (open (FILE, "<", $file)) {
die "Error: can't open file '$file': $!\n";
}
open (FILE, "<", $file) or die "Error: can't open file '$file': $!\n";
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
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @persons;
$persons[0] = [];
while(<DATA>) {
chomp;
push @persons, [] and next if /^\s*$/;
push @{$persons[-1]}, $_;
}
#print Dumper \@persons;
print Dumper [grep { $_->[2] eq 'male' } @persons];
_ _DATA_ _
Horst
Mustermann
male
Tina
Mustermann
female
Otto
Mustermann
male
Quote#!/usr/bin/perl -w
use strict;
my $input;
open($input, "<", "Datei.txt") or die "kann Datei.txt nicht lesen: $!\n";
while(<$input>) {
my ($ip) = $line =~ /IP-Adresse\.((?:\d+\.)+\d+)/;
print $ip;
}
close($input);
|< 1 2 3 4 5 >| | 47 Einträge, 5 Seiten |