Are you sure you know what this 'if' statement is doing? It always evaluates true. and the m/$litem/$matchitem/i shouldn't be in quotes.
if($litem, "/$matchitem/"){ ## always true $PNdString =~ "m/$litem/$matchitem/i"; ## not a pattern match if it's in quotes print (OUTFILE "$PNdString\n"); } else{ print(OUTFILE "$litem\n"); } > -----Original Message----- > From: Anthony Saffer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 18, 2002 9:04 AM > To: Perl Beginners List > Subject: Question about Error > > > 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); > > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]