in reply to Re^2: Perl Analyzer?
in thread Perl Analyzer?

Ideally, you're right: code like that should be refactored unless there's a good reason not to do so (like a requirement to maintain subroutine interfaces, as it was in the pencolor case I mentioned. The code was actually in Fortran-66, and I detest ENTRY statements).

It would, however, be quite difficult to have a program determine that two subs are doing the same thing, using different code, like one calculating factorials recursively and another doing so with a loop.

emc

Experience is a hard teacher because she gives the test first, the lesson afterwards.

Vernon Sanders Law

Replies are listed 'Best First'.
Re^4: Perl Analyzer?
by adrianh (Chancellor) on Aug 17, 2006 at 07:06 UTC
    It would, however, be quite difficult to have a program determine that two subs are doing the same thing, using different code, like one calculating factorials recursively and another doing so with a loop.

    So difficult as to be impossible in the general case - since it reduces to the halting problem.