in reply to not able to compare files
#!perl use strict; my (%schds, %conts, %in_conts_not_schds); open( MILF, "C:/junk/scheduled.txt" ) or die "Can't open scheduled.txt +\n"; while( <MILF> ) { split(/\s+/,$_); $schds{lc(@_[0])}=1; } close MILF; open( CONT, "C:/junk/contact.txt" ) or die "Can't open contact.txt\n"; while( <CONT> ) { split(/\s+/,$_); $conts{lc(@_[0])}=[@_[0], @_[1]]; #Retain case of name } close CONT; foreach (keys %conts) { unless (exists $schds{$_}) { $in_conts_not_schds{$conts{$_}->[0]} = $conts{$_}->[1]; } } foreach (sort keys %in_conts_not_schds) { print "$_ $in_conts_not_schds{$_}\n"; } ___END... FILES FOLLOW____ scheduled.txt Sam 5:00 scott 4:45 saleem 5:00 Ken 7:00 Ken 8:00 contact.txt sam 324-232-3333 Joe 235-309-3333 Saleem 323-747-0000 Ken 764-636-9999
|
|---|