sub match_re { my $self = shift; # retrieve from cache if it's there: my $re = $self->{match_re}; return $re if defined $re; # otherwise compute it and store it: $re = $self->match_string; $re = qr/\Q$re\E/; return $self->{match_re} = $re; }