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

renee
 2003-11-29 00:11
#73166 #73166
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Ich kann für nichts garantieren, aber probier mal folgendes:
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
use warnings; 
use strict;
use diagnostics;
use Archive::Zip;
use Archive::Zip::MemberRead;

$String = "strict";   #Such String

my @file2 = qw (PIXX_SRV_LF5.LOG
            PIXX_SRV_LF5.LOG.1
            Datei.log );#Verschieden Dateien im ZIP Archive
my @file = glob ("*.zip");
foreach my $file (@file){
 my $zip = new Archive::Zip($file);
 print "$file\n";
   foreach my $file2 (@file2){
      my $fh  = new Archive::Zip::MemberRead($zip, $file2);
      my $zeile = 0;
      while (defined($line = $fh->getline())) {
        chomp($line);
         ++$zeile;
         if ($line =~ /$String/) {
           print "Found in Line $zeile: $line\n in ZipFile $file File $file2\n";
           $fh->close();
          }
         }
         print "$file2\n";
       }
}#Liste der *.ZIP Dateien
\n\n

<!--EDIT|renee|1070057633-->
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Subroutinen: Wie macht man das?