Thread Kleine Tabelle in einen Hash einlesen
(2 answers)
Opened by Florian at 2012-04-04 21:52
was kannst du denn schon?
ungetestet: Code (perl): (dl
)
1 2 3 4 5 6 7 8 my $sth = $dbh->prepare("SELECT MODULENAME, de, en, fr FROM t"); $sth->execute; my $modules; while (my $row = $sth->fetchrow_hashref) { for my $lang (qw/ de en fr /) { $modules->{ $row->{MODULENAME} }->{ $lang } = $row->{ $lang }; } } Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wie frage ich & perlintro brian's Leitfaden für jedes Perl-Problem |