Hi everybody: I have two arrays(@nwarray0 and @nwarray1) in my program and i want to make sure that all the elements in @nwarray0 could be found in @nwarray1. Here is my implementation: ------------------------------------------------------- foreach my $srctemp ( @nwarray0 ) {
foreach my $tgttemp ( @nwarray1 ) { if ( $tgttemp eq $srctemp ) { $found = 1; last; } } if ( $found == 1 ) { $found = 0; next; } else { return 1; } } -------------------------------------------------------- But this algorithm takes a long time to compare, could you please help to improve this piece of code to less the time needed? Thanks in advance.