in reply to creating a regular expression's alternation dynamically?

Your while loop isn't needed. Just say chomp(my @list = <DATA>);

You don't want to apply quotemeta ("\Q...) to the whole regex, since that will make the | characters match literally. You also need to beware of having things earlier in the list that match a prefix of something later in the list, if what part of the string your regex matches matters to you. For instance:

print "foobarbaz" =~ m/(foo|foobar|baz)/g; print "foobarbaz" =~ m/(foobar|foo|baz)/g;
print different things. To ensure that a list element is never matched where it is a prefix of another element that would match, sort the list by descending length.

See Re: Common Perl Idioms for an implementation.