You can try making a hash of names out of file C (just set $hash{$name} = 1;), and then just check each name with
unless($hash{$name}){ do something... } -----Original Message----- From: Andrej Kastrin [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 15, 2006 8:29 AM To: beginners@perl.org Subject: Hash problem Dear Perl users, I have some problems wih the folowing algorithm: <snip> And now the main problem. I want to add File C, which will contain certain names, e.g.: Castro John etc. How to modify my script to sum only those AD's from file A, which not exists in file C. E.g.: if Castro and John exists in file C, then the result must be: 001 - 45 #ID is 001 and Bill (20) = 20 -->omit Castro (20) and John (5) 002 - 20 #ID is 002 and Andrew (10) + Mike (10) = 20 <snip> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>