axtens wrote:
G'day everyoneI'm confused. I'm trying to make use of Tie::Hash::TwoWay to give me access to a dictionary of word <=> misspelling. Has anyone got any idea how I would use TwoWay for this? Nothing I do seems to work. my $secondary = $dict->{0}; while ( ($k, $v) = ( each %$secondary ) ) { print $k . "\t" . $v . "\n"; } my $primary = $dict->{1}; while ( ($k, $v) = ( each %$primary ) ) { print $k . "\t" . $v . "\n"; }
Your code looks ok. What is it doing wrong? Or what isn't it doing that it should be? Can you give us an example of your data please? I can't see how you're expecting to use this module for mispellings. If you use a properly-spelled word as the hash key it will return a list of misspellings. If you use a misspelled word as a key it will offer you a list of corresponding properly-spelled ones. Is that what you want? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
