Omukawa has asked for the wisdom of the Perl Monks concerning the following question:
I think I don't quite understand how split() works. I'm currently working on a script, which reads a db full of raw entries of a dictionary and sorts and converts them into XeTeX format. I use hashes of hashes to store the entries.
The following part of the script should look if there two words seperated by ";", split them, put them in an array @engdict with all of the information that belongs to them.
for $_ (%edict) { # for entries with more than one keyword if ($edict{$count}{english} =~ /;/) { @foo = split (/; /, $edict{$count}{english}); for $_ (@foo) { $engdict[$no] = "\\textbf{".$foo[$_]."}"; print $foo[1]; $engdict[$no] = $engdict[$no]."\\textmd{$dict{$cou +nt}{puma}}"; $engdict[$no] = $engdict[$no]."\\textit{$dict{$cou +nt}{ps}}"; $no++; }; delete $edict{$count}; } else { $count++; }; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split() Problem
by Joost (Canon) on Jul 21, 2008 at 22:01 UTC | |
|
Re: split() Problem
by moritz (Cardinal) on Jul 21, 2008 at 21:56 UTC | |
|
Re: split() Problem
by CountZero (Bishop) on Jul 21, 2008 at 22:34 UTC | |
|
Re: split() Problem
by Omukawa (Acolyte) on Jul 22, 2008 at 09:51 UTC | |
by moritz (Cardinal) on Jul 22, 2008 at 10:08 UTC | |
by Omukawa (Acolyte) on Jul 22, 2008 at 10:52 UTC |