http://qs321.pair.com?node_id=211030


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