in reply to Most recent pattern match

Try something like

my $regexp = Regexp::Assemble->new( flags => 'i', track => 1 )->add(@patterns); if( $regexp->match($string) ) { print "$string was matched by pattern ", $regexp->matched, "\n"; }

This doesn't use $&, and also performs only a single match, no looping required. You could use the matched pattern as a key into a hash, and set up a dispatch table.

• another intruder with the mooring in the heart of the Perl