qnguyen has asked for the wisdom of the Perl Monks concerning the following question:
open (FILEIN2, $filetwo) or die "Can't open file.\n"; open (FILEOUT8, ">$hashtable") or die "Can't open debug file to be tr +anslated.\n"; ## Go through each line and replace while (<FILEIN2>) { next unless ( /.:\s*\S/ ); my ( $lang, $text ) = split /:/, $_, 2; if ( $lang eq "Default" ) { $englishword = trim( $text ); # takes care of chomping } elsif ( $lang eq "Spanish_LatinAmerican|es_MX" ) { $spanishword = trim( $text ); $langhash{$spanishword} = $englishword; } } while (($spanishword, $englishword) = each %langhash){ ## Tes +t print of entire hash table print FILEOUT8 "$spanishword => $englishword\n"; } close(FILEIN2); close(FILEOUT8);
Comment: No Translation Needed Default: 1 Translate: FALSE Spanish_LatinAmerican|es_MX: uno Comment: No Translation Needed Default: 3 Translate: FALSE Spanish_LatinAmerican|es_MX: tres Comment: No Translation Needed Default: <Spell> {ASSIGNMENT[WORKID=PICKS[].WORKID].ROUTE} </Spell> Translate: FALSE Spanish_LatinAmerican|es_MX: <Spell> {ASSIGNMENT[WORKID=PICKS[].WORKID +].ROUTE} </Spell> Phonetic: range Pron: range Spanish_LatinAmerican|es_MX: rango Display: range Spanish_LatinAmerican|es_MX: rango Phonetic: range Pron: range Spanish_LatinAmerican|es_MX: listo Display: ready Spanish_LatinAmerican|es_MX: listo Comment: This prompt occurs at the end of an assignment telling the op +erator the assignment is complete and if needed, also tells the opera +tor shorts have occured. Shorts are when an operator picks less items + at a location then they were supposed to. Default: Picking complete. Spanish_LatinAmerican|es_MX: Selección completa.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question on building hash table
by jdporter (Paladin) on Nov 08, 2007 at 01:28 UTC |