Thread Subroutinen: Wie macht man das? (4 answers)
Opened by Rambo at 2003-11-28 21:15

Rambo
 2003-11-29 19:38
#73167 #73167
User since
2003-08-14
803 Artikel
BenutzerIn

user image
hi, ansich war der Code nicht verkehrt :-) nur muss man
wissen wo man das FH->close setzt :-)
hier falls es jemanden intersiert der code
Code: (dl )
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
use strict; 
use warnings;
use diagnostics;
use Archive::Zip;
use Archive::Zip::MemberRead;

#****************************
# Search String
#****************************
my $String = "strict";

#****************************
# Search over all ZIP Files
#****************************
my @Zip_File = glob ("*.zip");
for my $Zip_File (@Zip_File){

#****************************
#
#****************************
my $zip = new Archive::Zip($Zip_File);

#****************************
# Files to be read
#****************************
my @file2 = qw (Datei1.log PIXX_SRV_LF5.LOG);
for my $file2 (@file2){

#****************************
# Open Zip Archive for
# reading Files
#****************************
my $fh  = new Archive::Zip::MemberRead($zip, $file2);

#****************************
# Line number call for
# Search String
#****************************
my $zeile = 0;
while (defined(my $line = $fh->getline())) {
   chomp($line);
   ++$zeile;
   if ($line =~ /$String/) {
   print "Found in Line $zeile: $line\n in ZipFile $Zip_File File $file2\n\n";
   }
  }
 $fh->close();
}
}


danke für die Hilfe!!

View full thread Subroutinen: Wie macht man das?