Update: This detects BM_allocation_0 even when it is part of RCF_BM_allocation_0, but it is unclear what is required here.use strict; use warnings; my @array1 = qw (abc_RCF_BM_allocation_0_kl aplc_RCF_BM_allocation_0_in_nml fbe_RCF_BM_allocation_0_in_tvg ap_hu_BM_allocation_0_in_nml); my @array2 = qw(RCF_BM_allocation_0_in BM_allocation_0 RCF_BM_allocation_0); for my $pattern (@array2) { my @results = grep /$pattern/, @array1; print "$pattern is in @results\n"; }
In reply to Re: check 2 string arrays
by cdarke
in thread check 2 string arrays
by sharan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |