I'm very new to Perl and am attempting to write a script to search through a file and check/match a number of strings from an additional input file. Here's what I have as of right now:
#! /css/dvltools/localperl/bin/perl
open CUMRT603, "CUMRT603";
my $meter, $my_cur_line;
while ( <CUMRT603> )
{
$my_cur_line = $_;
chomp $my_cur_line;
open METER_LIST, "mlist";
while ( <METER_LIST> )
{
$meter = $_;
if ( $my_cur_line =~ /"$meter"/ )
{
print "Found $meter on $my_cur_line";
}
}
close METER_LIST;
}
Basically, I'm searching CUMRT603 for any string found in list (mlist). I can't get it to show any string matches (There should be at least one). Any advice on syntax, structure, etc. is apperciated. This is bascially my first perl script.
grep -Fx file1 file2bash command.