Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: how to avoid mis-spelling hash keys?

by graff (Chancellor)
on Jan 05, 2003 at 18:21 UTC ( #224442=note: print w/replies, xml ) Need Help??


in reply to Re: how to avoid mis-spelling hash keys?
in thread how to avoid mis-spelling hash keys?

I think doing approximate string matches for hash keys in objects would be the programmer's equivalent to playing Russian Roulette. Bad idea.
  • Comment on Re: Re: how to avoid mis-spelling hash keys?

Replies are listed 'Best First'.
Re: Re: Re: how to avoid mis-spelling hash keys?
by Beatnik (Parson) on Jan 05, 2003 at 18:25 UTC
    Well, if there is an exact match, it's no roulette. There are quite simple techniques to verify a hash key actually exists. In fact, like janx noted above, there's Tie::Hash::Approx by our very own OeufMayo which does pretty much just that :)

    Tie::Hash::Approx - Approximative match of hash keys using String::Approx

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://224442]
help
Chatterbox?
[ovedpo15]: If I use "unless(opendir(my $dir, $test_dir))" why does it give me error "Global symbol "$dir" requires explicit package name at" if I used "my"? If I use my $dir before the opendir it works.. but why?

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-04-22 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?