Perhaps something like this: my $counter; foreach(@rootwords){ $counter++; $_ .= "\n"; if($_ =~ /(\b$input\b)/){ print "Found match on line number $counter\n"; } }
At least I think that's what you're looking for. -----Original Message----- From: viswanathan sundararajan To: [EMAIL PROTECTED] Sent: 3/21/02 9:14 PM Subject: Regarding reg. expr Hi group, I have the following code. $in=join("\n",@rootwords); while($in=~/(\b$input\b)/g) { ..... ..... } Is there any way of finding out the line no where $input is matched with $in.$in may contains many instances of $in.I need all those line nos. Thanx in advance, visu __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards. http://movies.yahoo.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -------------------------------------------------------------------------------- This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]