http://qs1969.pair.com?node_id=321263

rkg has asked for the wisdom of the Perl Monks concerning the following question:

Hi.

I have an app that solicits regexps from users then uses them to filter data.

Here's a code snippet that greps objects from a list (here named @x) whose regexps match a predefined hunk of text (here named matchtext).

my @matches = map { $_->result} grep { my $re = $_->regex; $matchtext =~ /$re/i; } @x;
My two questions: Thanks for your advice.

rkg

Hey, my 100th post! Whoop Whoop Whoop Whoop