#!/usr/bin/perl my $can_list; my $can_archive; if (@ARGV) { $can_list = $ARGV[0]; $can_archive = '\"'.$ARGV[1].'\"'; } else { die "Need both new candidate list and candidate list archive!"; } # Open candidate list open LIST, $can_list or die "Cannot open new candidate list file! $!"; # Open results log open LOG, ">/data/My Documents/candidates_results.log" or die "Could not open candidate search log!"; while () { @results = `grep -i $_ $can_archive`; foreach $result (@results) { print LOG $result . "\n"; } } close LOG; close LIST;