use strict; use warnings; my @array = qw(trend_report revenuebytrafficker revengebysmoker); my $value = qr'reve.*ker'; my @matches = grep {/$value/} @array; print ("Matched :" . (join ": :", @matches) . ":\n") if @matches;