Thread Liste in Tabellenformat umwandeln (19 answers)
Opened by Rambo at 2016-06-24 15:19

renee
 2016-06-25 14:56
#184961 #184961
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Dafür kann man auch gut $/ nehmen...

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
use strict;
use warnings;
use Data::Dumper;

my $result = {};
local $/ = "\n\n";
while(my $block = <DATA> ){
chomp $block;
my %info = map{
split /\s*:\s*/, $_, 2
}split /\n/, $block;

my $oid = $info{SamAccountName};
$result->{$oid} = \%info;
}
print Dumper $result;


__DATA__
SamAccountName : U011004
LastLogonDate : 20.06.2016 15:01:10
ExpiryDate : 19.12.2016 13:58:05
PasswordLastSet : 20.06.2016 14:58:05
mail : J.W@dbx.com

SamAccountName : U011001
LastLogonDate : 25.05.2016 09:53:51
ExpiryDate : 23.11.2016 08:53:28
PasswordLastSet : 25.05.2016 09:53:28
mail : MM.AA@yxz.de
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 Liste in Tabellenformat umwandeln