I think perl does in fact switch to taintedness if the program starts with different uid and euid. So if you cannot set the uid from the other program, maybe you would want to do something like this:
if ($UID != $EUID) {
$UID=$EUID;
exec($0, @ARGV);
die $!;
}