Something like this?
#! perl -sw use strict; my @array1 = ("tmp0.size", "tmp0.buffersize", "tmp0.value", "tmp1.size +", "tmp1.buffersize", "tmp1.value"); my @array2 = ("size", "buffersize"); my %seen = map { $_ => 0 } @array2; my @results = grep { /.+\.(\w+)/; my $s = $1; !exists $seen{$s} or ($seen{$s}++ < 1); } @array1; local $" = $/; print "@results\n"; __DATA__ C:\test>200392 tmp0.size tmp0.buffersize tmp0.value tmp1.value C:\test>
In reply to Re: Partial Array Comparision
by BrowserUk
in thread Partial Array Comparision
by johnirl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |