Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: hash key regular expression pattern

by dada (Chaplain)
on Nov 07, 2002 at 09:53 UTC ( #211030=note: print w/replies, xml ) Need Help??


in reply to hash key regular expression pattern

use Tie::RegexpHash from CPAN!

there's also Tie::Hash::Regex by our fellow davorg, but I can't see the difference between the two :-)

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

  • Comment on Re: hash key regular expression pattern

Replies are listed 'Best First'.
Re: Re: hash key regular expression pattern
by davorg (Chancellor) on Nov 14, 2002 at 13:01 UTC

    There is a difference, but it's a bit subtle.

    With Tie::RegexpHash you set your hash keys to regular expressions and then look them up using fixed strings.

    With Tie::Hash::Regex you set the keys to fixed strings and then look them up using regular expressions.

    In this case, it looks like Tie::RegexpHash is the way to go.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://211030]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2022-05-22 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?