sub main { my $input_qfn = "input.file"; my $pattern_qfn = "pattern.file"; my %emailAddresses; { open(my $input_fh, '<', $input_qfn) or die("Can't open input file \"$input_qfn\": $!\n"); while (<$input_fh>) { chomp; my ($userName, $emailAddress, $division, $fullName) = split /\|/ +; ++$emailAddresses{$emailAddress}; } } open(my $pattern_fh, '<', $pattern_qfn) or die("Can't open pattern file \"$pattern_qfn\": $!\n"); while (<$pattern_fh>) { chomp; if ($emailAddresses{$_}) { print "$_ exists in the input file\n"; } else { print "$_ doesn't exist in the input file\n"; } } }
Randall@domain.com doesn't exist in the input file David@domain.com exists in the input file Rob@domain.com doesn't exist in the input file Tania@domain.com exists in the input file
In reply to Re^2: Look for pattern in file. ????
by ikegami
in thread Look for pattern in file. ????
by davidinottawa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |