in reply to comparing two array
!/usr/bin/perl use strict; my %list; my @a = qw( 1 2 3 ); my @b = qw( 3 1 5 ); for my $i (@a) { $list{$i}++ if ( grep /$i/, @b ); } print "Results:\n" . join ", ", keys %list;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: comparing two array
by afoken (Chancellor) on Jun 17, 2009 at 18:19 UTC |