in reply to Pair of items
Put in a loop, as necessary. Lather, rinse, repeat. A few notes:sub is_ok { my ($x, $y) = @_; my (%x, %y); @x{@$x} = 1; @y{@$y} = 1; foreach my $k (keys %x) { return 0 if exists $y{$k}; } return 1; }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pair of items
by tadman (Prior) on Jul 29, 2003 at 20:14 UTC | |
|
Re: Re: Pair of items
by Anonymous Monk on Jul 30, 2003 at 16:09 UTC | |
by dragonchild (Archbishop) on Jul 30, 2003 at 16:27 UTC |