in reply to Comparing arrays and returning number of similar elements
Thanks..my @arr1 =("fg", "dg", "tu","ph", "dgs",,"dg"); my @arr2 = ("dgs","sfd","dg","ph","rhd"); my %hash ; $hash{$_}++ for (@arr1,@arr2) ; print $_ ."\n" for grep {$hash{$_}>1}keys %hash ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Comparing arrays and returning number of similar elements
by Roy Johnson (Monsignor) on Feb 10, 2006 at 15:43 UTC |