Thread Doppelpunkt falsch angezeigt.
(16 answers)
Opened by MiMue at 2018-07-27 11:06
Dein Ausgabeformat sieht aus wie YAML, daher hier noch ein Ansatz:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 use YAML::XS; open my $fh, "<", "woerter.txt" or die $!; chomp(my @wordlist = <$fh>); my %words; for my $word (@wordlist) { $words{ $word } = { type => 'n', genus => 's' }; } print Dump(\%words); 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: ![]() ![]() |