if ($t ne '') {
$new =~ s/(['\\])/\\$1/g;
print OUT $t,
- "eval 'sub $name $proto\{\n$t ${args}eval \"$new\";\n$t}';\n";
+ "eval 'sub $name $proto\{\n$t ${args}eval \"$new\";\n$t}' unless defined(\&$name);\n";
}
else {
- print OUT "sub $name $proto\{\n ${args}eval \"$new\";\n}\n";
+ print OUT "unless defined(\&$name) {\nsub $name $proto\{\n ${args}eval \"$new\";\n}\n}\n";
}
%curargs = ();
}
$new = 1 if $new eq '';
if ($t ne '') {
$new =~ s/(['\\])/\\$1/g;
- print OUT $t,"eval 'sub $name () {",$new,";}';\n";
+ print OUT $t,"eval 'sub $name () {",$new,";}' unless defined(\&$name);\n";
}
else {
- print OUT $t,"sub $name () {",$new,";}\n";
+ print OUT $t,"unless(defined(\&$name) {\nsub $name () {",$new,";}\n}\n";
}
}
}