in reply to Subtracting Lists
my %results; @goodstuff = (1,2,3,4,5); @badstuff = (1,3); for (@goodstuff) { $results{$_}++ } for (@badstuff} { $results{$_}++ } for (keys %results) { if ($results{$_} == 1) { print "Value: " . $_ . " was found in only one array\n"; } }
I think that is right, I just coded it off the top of my head so no promises...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subtracting Lists
by ikegami (Patriarch) on Jun 02, 2008 at 00:54 UTC | |
by NetWallah (Canon) on Jun 02, 2008 at 06:00 UTC | |
by ikegami (Patriarch) on Jun 02, 2008 at 06:12 UTC | |
by educated_foo (Vicar) on Jun 02, 2008 at 16:38 UTC | |
by ikegami (Patriarch) on Jun 02, 2008 at 06:03 UTC | |
by NetWallah (Canon) on Jun 02, 2008 at 06:09 UTC | |
by blazar (Canon) on Jun 02, 2008 at 17:03 UTC | |
|
Re^2: Subtracting Lists
by blazar (Canon) on Jun 02, 2008 at 16:54 UTC |