in reply to How to make sure no elements from @array are inside $scalar

Hi Steffen,

A possible more elegant way:

use strict; my $text = 'f000124_90181234_dp'; my $sites = [ '018', '324' ]; if (grep {$text =~ /_9$_/} @$sites) { print "To be removed..\n"; }