#!/usr/bin/perl use strict; use warnings; my $File1 = <; # throw away header line while (<$fh1>) { my ($name, $title) = split /, /; $occupation{$name} = $title; } close $fh1 or die $!; open my $fh2, '<', \$File2 or die $!; <$fh2>; # throw away header line while (<$fh2>) { my ($name, $title) = split /, /; if (exists $occupation{$name} and $occupation{$name} ne $title) { print $name, " => Prev: $occupation{$name}, Now: $title\n"; } } close $fh2 or die $!; #### C:\Old_Data\perlp>perl test2.pl Jim => Prev.: MD, now: Doctor Julie => Prev.: MD, now: Doctor George => Prev.: MD, now: Doctor Uma => Prev.: MD, now: Doctor Pete => Prev.: MD, now: Doctor