'; $img_path = 'img'; $bildertexte_path = "intern/bilder.txt"; $zaehler_path = 'zaehler.txt'; foreach $i (@typen) { foreach $j (<$img_path/$i/*.jpg>) { push @{"img_$i"}, $j; } } open FR, "< $bildertexte_path"; while () { chomp; my ($f,$txt) = split /\t/,$_,2; $img_txt{$f} = $txt; } close FR; sub zaehler { open FR, "< $zaehler_path"; my $z = ; close FR; chomp $z; $z ++; open FW, "> $zaehler_path"; print FW $z; close FW; return $z; } sub bild { my $typ = shift; my $img = ${"img_$typ"}[int(scalar(@{"img_$typ"})*rand())];; my $txt = $img_txt{substr($img,length("$img_path/"))}; # if ($typ eq 'kultur') { # $img = $kultur[int(scalar(@kultur)*rand())]; # } elsif ($typ eq 'kunst') { # $img = $kunst[int(scalar(@kunst)*rand())]; # } elsif ($typ eq 'wissenschaft') { # $img = $wissenschaft[int(scalar(@wissenschaft)*rand())]; # } elsif ($typ eq 'technik') { # $img = $technik[int(scalar(@technik)*rand())]; # } return ""; } !>

卡塞尔 & 格林兄弟童话与世界紧密相连

欢迎光临