I've resolved my problem with the following changes: First, I took 'while <IN> out of the loop, substituting 'for (@in) {' and ahead of the loop added '@in = <IN>; Then I broke my pattern-search problem into two parts: I incremented $p in a for loop as previously shown, then $pp = "$p" and put the escaped parenthesis and other characters in the pattern search itself: /p\($pp\)=/ and it ran fine I will shortly check whether I can just use $p itself in the pattern and fool around with arithmetic vs character match -- David -- ------------------------- www.richsob.com There are only two kinds of men -- the dead and the deadly. -- Helen Rowland - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.linux-learn.org/faqs