Good Morning Everyone,
Got another question: I wrote my first Perl script last night and it seemed to be
error free on Windows. But when I uploaded it to Linux (RH 7.3) it threw an error that
I don't understand. From a Google search it seems there could be a number of problems
and I am not experience enough to know which. The error I am getting is:
Nested quantifiers before HERE mark in .... then it gives my regular expression
followed by the first line of the file.
I THOUGHT this code was right. But obviously it isn't. Can someone tell me why line 29
would be throwing this error or WHAT the error means? The entire code is below. Thanks
again for all the help. This list has been a lifesaver.
Anthony
CODE:
my $PNdString = "";
sub process_files{
open(FH, "< $_") or die("Error! Couldn't open $_ for reading!! Program aborting.\n");
open(MTH, "< /home/losttre/sorted.txt") or die("Error! Couldn't open $MTH for
reading!\n");
open(OUTFILE, "> temp.dat") or die ("Couldn't open temp file! Aborting\n");
@MTH = <MTH>;
@fcontents = <FH>;
foreach $matchitem (@MTH){
foreach $litem (@fcontents){
if($litem, "/$matchitem/"){
$PNdString =~ "m/$litem/$matchitem/i";
print (OUTFILE "$PNdString\n");
}
else{
print(OUTFILE "$litem\n");
}
}
}
print "Done\n";
}
find(\&process_files, @ARGV);