#!/usr/bin/perl -w use strict; open my $config, "config.cfg" or die "config.cfg: $!\n"; # Assuming the config file structure is one error per line my %errlist = map { chomp; $_ => 1 } <$config>; close $config; open my $log, "logfile.txt" or die "logfile.txt: $!\n"; while (<$log>){ chomp; /:([^:]+)$/; print "Error '$1' found on line $.\n" if exists $errlist{$1}; }