in reply to Good Idiom for Matching List?
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*
|
|---|