in reply to Comparing 2 arrays but ignoring certain patterns

Another case of hash avoidance, and no need for multiple split calls:

>perl -wMstrict -le "my @testlist = qw( ctahci cptcsa0 ctsata:25:seed cptcsa1:50:seed ctsata_1:25:seed ); my @removelist = qw(cptcsa0 ctsata cptcsa1); ;; my $remove = join ' | ', @removelist; $remove = qr{ $remove }xms; print $remove; ;; my @newlist = grep ! m{ \A $remove \b }xms, @testlist; print qq{'$_'} for @newlist; " (?^msx: cptcsa0 | ctsata | cptcsa1 ) 'ctahci' 'ctsata_1:25:seed'