in reply to Return rows from 2 csv files that don't match
my %hash; while ( my ( $ip, $other_stuff ) = parse_values_file_1() ) { $hash{ $ip } = 1; } while ( my ( $ip, $other_stuff ) = parse_values_file_2() ) { print "Not found: $ip ($other_stuff)\n" unless $hash{ $ip }; }
I'll leave the implementation of the parsing as an exercise for now. What you have here is a check for uniqueness. Whenever you think "uniqueness test" and "Perl", think "I can probably use a hash for that".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Return rows from 2 csv files that don't match
by meredib (Acolyte) on Feb 19, 2009 at 18:59 UTC |