#!/usr/bin/perl # https://perlmonks.org/?node_id=1217240 use strict; use warnings; open my $patterns, '<', \<; my $match = qr/^\w*($seqs)/; /$match/ and print "$1\t$_" while <$fh>;