in reply to Regex Problem

seems like you're trying to parse XML? why don't you try something like XML::Simple

or maybe this will work:
while ($ts=~ s|(?<=<item name=\"DISPLAY_ORDER\"><value>)\d+(?=\<\/va +lue><\/item><item name=\"PARAGRAPH_TEXT\">)|$paranum|si ) { print "Set PNum: $paranum\n"; $paranum++; }
(?<=... does a prematch, and (?=... does a postmatch.. and only changes the digit.
He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/