--- Birgit Kellner <[EMAIL PROTECTED]> wrote:
> Is it possible to test the presence of a hash key with a regexp?
> something like:
> if (exists ($hash{/add_\w+/})) { print "yippie!\n";}
>
> I know that this doesn't work, but is there something similar that does?
>
> Birgit Kellner
Birgit,
There two options that immediately spring to mind:
http://theoryx5.uwinnipeg.ca/CPAN/data/Tie-Hash-Regex/Regex.html
http://theoryx5.uwinnipeg.ca/CPAN/data/Tie-RegexpHash/RegexpHash.html
I don't know much about those modules other than having heard others recommend them.
They both
allow you to use regular expressions as hash keys.
Cheers,
Curtis Poe
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]