http://www.perlmonks.org?node_id=19688


in reply to Regex Interpolation

Curly braces should do the trick here, to separate your variable name from the '1': print "Success!\n" if $retVal =~ s/showpos=1/showpos=${main::pageVar}1/;