Subj : ANNOUNCE: Tie::RegexpHash v0.10 To : All From : Robert Rothenburg Date : Wed Feb 07 2001 03:02 pm From: Robert Rothenburg NAME Tie::RegexpHash - Use regular expressions as hash keys REQUIREMENTS `Tie::RegexpHash' is written for and tested on Perl 5.6.0. It uses only standard modules. SYNOPSIS use Tie::RegexpHash; my %hash; tie %hash, 'Tie::RegexpHash'; $hash{ qr/^5(\s+|-)?gal(\.|lons?)?/i } = '5-GAL'; $hash{'5 gal'}; # returns "5-GAL" $hash{'5GAL'}; # returns "5-GAL" $hash{'5 gallon'}; # also returns "5-GAL" my $rehash = Tie::RegexpHash->new(); $rehash->add( qr/\d+(\.\d+)?/, "contains a number" ); $rehash->add( qr/s$/, "ends with an \`s\'" ); $rehash->match( "foo 123" ); # returns "contains a number" $rehash->match( "examples" ); # returns "ends with an `s'" DESCRIPTION This module allows one to use regular expressions for hash keys, so that values can be associated with anything that matches the key. Hashes can be operated on using the standard tied hash interface in Perl, or using an object-orineted interface described. More detailed documentation is described in the module's POD. AVAILABILITY It should show up soon at a CPAN mirror near you in as: $CPAN/authors/id/R/RR/RRWO/Tie-RegexpHash-0.10.tar.gz --- BBBS/LiI v4.01 Flag-2 * Origin: Prism bbs (1:2320/38) .