#!/usr/bin/perl use strict; use warnings; my $file = "zipcodes.txt"; my %zipcodes; open (my $fh, '<', $file) or die "Can't open $file for read: $!"; while (<$fh>) { chomp; $zipcodes{$_}++; } close $fh or die "Cannot close $file: $!"; while (chomp( my $line = )) { print "found $line\n" if $zipcodes{ $line }; } __END__