aboutsummaryrefslogtreecommitdiff
path: root/devel/p5-Tie-Hash-Regex/pkg-descr
blob: a9237cbdd2f8988da69429fa0eafc603c35acdc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Someone asked on Perlmonks if a hash could do fuzzy matches on keys - this 
is the result.

If there's no exact match on the key that you pass to the hash, then the 
key is treated as a regex and the first matching key is returned. You can 
force it to leap straight into the regex checking by passing a qr'ed regex 
into the hash like this:

  my $val = $h{qr/key/};

exists and delete also do regex matching. In the case of delete all values 
matching your regex key will be deleted from the hash.

WWW: http://search.cpan.org/dist/Tie-Hash-Regex
Author: Dave Cross <dave@dave.org.uk>