i'm back.
what about using the (??{}) ("postponed" regular subexpression) construct?
try (untested)
my @names = qw( car carpet pet); my $goodnames = sub{ join( '|', map {quotemeta $_->[0] } sort { $b->[1] <=> $a->[1] } map { [$_, length ] } @_; ); }; # later... s/stuff (??{ $goodnames->(@names) }) stuff//;
~Particle *accelerates*
In reply to Re: Good Idiom for Matching List?
by particle
in thread Good Idiom for Matching List?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |