in reply to Problem with Tie::RegexpHash

The problem is that Tie::RegexHash is a tied module, meaning that you need to use the tied interface. Try:

use Tie::RegexpHash; my $rehash = tie my %rgxhash, 'Tie::RegexpHash'; $rehash->add( qr/abc/, "abc" ); $rehash->add( qr/def/, "def" );

Replies are listed 'Best First'.
Re: Re: Problem with Tie::RegexpHash
by Mr. Muskrat (Canon) on Oct 10, 2002 at 17:28 UTC

    I hate to tell you this but that's not the problem at all. Your code still results in the same warning when used in conjunction with use diagnostics and -w.

Re: Re: Problem with Tie::RegexpHash
by sch (Pilgrim) on Oct 10, 2002 at 17:33 UTC

    Tried using the tie method as well, but that also failed

    According to the POD, you can either use the tie method, or the OO interface - unfortunately neither of them seem to work!