If you just want to open a pipe to a Perl interpreter, you're on the right track. The only thing I think you're missing is that the Perl script itself is not executable. So you need to do this:
var = "/some/file/path/"
pipe = subprocess.Popen(["perl", "./uireplace.pl", var], stdin=subprocess.PIPE)
pipe.stdin.write(var)
pipe.stdin.close()