sub FETCH { my ($self, $key) = @_; my $is_re = (ref($key) eq 'Regexp'); return $self->{$key} if !$is_re and exists $self->{$key}; $key = qr/$key/ if !$is_re; if (wantarray) { return @{$self}{ grep /$key/, keys %$self }; } else { /$key/ and return $self->{$_} for keys %$self; } }
In reply to Re: Tie::Hash::Regex
by japhy
in thread Tie::Hash::Regex
by davorg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |