in reply to compare csv files only to first fullstop character
G'day john.tm,
Welcome to the monastery.
Use Text::CSV instead of rolling your own solution with all those split and splice statements.
Populate a hash with the first part of the address from the master file then compare with addresses from the daily file.
This code shows the basic idea of how to do that:
#!/usr/bin/env perl -l use strict; use warnings; my %seen; for (qw{john.co.uk gim.com}) { ++$seen{get_first_part_of_address($_)}; } for (qw{john.com gim elephant.com banana}) { print unless $seen{get_first_part_of_address($_)}; } sub get_first_part_of_address { return (split /\./, shift)[0] }
Output:
elephant.com banana
-- Ken
|
|---|