Thread Hash von Hashes einstiegsprobleme (19 answers)
Opened by v0id at 2007-03-12 18:01

renee
 2007-03-13 13:36
#74965 #74965
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Wer weiß, was da noch so für Dateien in dem Verzeichnis sind. Mach mal:
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
foreach my $file (@files) {
       #dateiname.20070117.001124.log

      if( my @info = $file =~ m/(.*)\.(\d{4})(\d{2})(\d{2})\.(\d{2})(\d{2})(\d{2})\.log/ ){
         
          my %subhash = ();
          @subhash{ qw/name year month day hour minute second/ } = @info;

my $key = 'end';

          if ( $info[0] ne $oldname )
          {
$key = 'begin';
          }

$dif_hash{ $info[0] } = {
$key => { %subhash }
};

          $oldname = $1;

      }

}


Und das my @info = () weiter oben raus...\n\n

<!--EDIT|renee|1173785897-->
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 Hash von Hashes einstiegsprobleme