in reply to Finding problem with finding keywords in arrays / files

#!/usr/local/bin/perl -w use strict; open(my $input, '<', 'data.txt') or die $!; my @data = <$input>; open(my $fh, '<', 'keyword.txt') or die $!; my $keyword = do { local $/; <$fh> }; my @match = grep $keyword =~ /$_/, @data; print for @match;

What do you think ?