diff options
author | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-08-07 00:00:00 +1200 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-08-07 00:00:00 +1200 |
commit | 3d271ce79d39df56470393916b3d33ff26db2c8b (patch) | |
tree | 975dcfcb755c5793ecce56f7dfabb4b929bdbb01 /utils/h2ph.PL | |
parent | 46183fdc0e79bd6fdebfcbb6f40b5c0db93bbfad (diff) | |
download | perl-3d271ce79d39df56470393916b3d33ff26db2c8b.tar.gz |
h2ph corrections to avoid redefined sub warnings
(this is the same change as commit 46f24c54ba4249e3ea156261098960de79140a11, but as applied)
Diffstat (limited to 'utils/h2ph.PL')
-rw-r--r-- | utils/h2ph.PL | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 3471300c87..d48571f00f 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -116,10 +116,10 @@ foreach $file (@ARGV) { 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 = (); } @@ -129,10 +129,10 @@ foreach $file (@ARGV) { $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"; } } } |