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

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 :-)


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.


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

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://211030]
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
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (80 votes). Check out past polls.