Thread Elegante Syntax für Hash-Def (11 answers)
Opened by bianca at 2010-03-27 12:41

bianca
 2010-03-27 13:38
#135358 #135358
User since
2009-09-13
7016 Artikel
BenutzerIn

user image
2010-03-27T12:35:04 renee
Diese zwei Varianten sollte es tun:

Extrem geil, Danke DIR vielmals!


Meine Endlösung also folgende:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
my %tabelle;
foreach (split m!$/!,
<<KONSTANTE
foo                     N
foo2                    X
bar                     A
KONSTANTE
) {
        my $counter = (keys %{$tabelle{head}}) + 1;
        ($tabelle{head}->{$counter},$tabelle{typ}->{$counter}) = split /\t+/,$_;
}
print Dumper(%tabelle);
10 print "Hallo"
20 goto 10

View full thread Elegante Syntax für Hash-Def