in reply to RE: Re: Regex Interpolation
in thread Regex Interpolation

The problem comes from the 1 at the end of $main::pageVar. Perl thinks that the variable is $main::pageVar1. To distinguish the variable from the literal 1 change the variable reference to ${main::pageVar} so that the regex looks like print "Success!\n" if $retVal=~s/showpos=1/showpos=${main::pageVar}1/;