James Kelty wrote:
> Say I have two large lists of names (uid's). I would like to look at
> both of these files and make sure that a name (uid) doesn't appear in
> BOTH files. Just one or the other. Not sure how to handle that. Any ideas?
The short answer is
perldoc -q duplicate
The long one is, what does 'make sure' mean? I can think of several
ways, all more or less destructive, to make sure there are no duplicates
between the files. But how about this code to /find out/ if
there are duplicates; then you can wreak whatever destruction is
appropriate.
my %uids = do {
local @ARGV = 'file1';
map { ($_, undef) } <>;
};
my $already = do {
local @ARGV = 'file2';
grep {exists $uids{$_}} <>;
};
if ($already) {
:
}
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]