C:\test>perl -wE"no warnings 'redefine';sub FOO(){23};sub FOO(){42 if
+$];};say$];"
Constant subroutine FOO redefined at -e line 1.
5.014002
Dropping the prototype isn't an option either because the constant getting redefined is a very rare occurence (but one that must be catered for), and I don't want to lose the benefits of compile time optimisations for the majority of cases.
If a constant sub is redefined to be the same value, it doesn't cause the warning: C:\test>perl -wE"no warnings 'redefine';sub FOO(){23};sub FOO(){23};sa
+y$];"
5.014002
which will be the majority of cases, but I cannot predict when the edge case might occur so I have to try the redefinition in all cases.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP Neil Armstrong
/div |