my %HoL = ( 'cluster1' => [ 'remap.config', 'remap.config.hosts', 'origin.db', 'origin.db.hosts', 'local_cluster.db', 'local_cluster.hosts' ] ); my $cluster = 'cluster1'; my @array = @{$HoL{$cluster}}; my $find = 'remap.config.hosts'; my @matches = grep { /\Q$find\E/ }@array; print "Found @matches" if @matches;