http://www.perlmonks.org?node_id=469211


in reply to One line assigment statement with regex match

something like:

@terms = ("Word1","Word2","Word3"); $match = $1 if join (" ", @terms) =~ /((?:^| )$lineFromSomeTextFile(?: + |$))/;

Perl is Huffman encoded by design.