#!/usr/bin/perl use warnings; use strict; unless ( @ARGV == 2 ) { die "Need both new candidate list and candidate list archive!\n"; } my ( $can_list, $can_archive ) = @ARGV; # Open candidate list open LIST, '<', $can_list or die "Cannot open new candidate list file! $!"; chomp( my @new_candidates = ); # Open results log open LOG, '>', '/data/My Documents/candidates_results.log' or die "Could not open candidate search log: $!"; open LIST, '<', $can_archive or die "Cannot open '$can_archive' $!"; while ( my $line = ) { foreach my $result ( @new_candidates ) { print LOG $line if $line =~ /$result/i; } } close LOG; close LIST;