in reply to Seek Help Refactoring

It's a very good question, as it deals more with the philosophy of programming, and isn't a specific "why isn't such-and-such working?" the way the usual questions are.

In the absence of more information, I like CountZero's answer, because it's clean and simple.  But xdg's answer is a good one too, especially if there are cases where you might other subroutines (eg. gamma, delta, etc.) to call the new _internal_sub() subroutine.

I did want to point out that, when I encounter a situation like this, it often helps me to ask whether the two subroutines would be likely to evolve together?  That is, if you were to make a change/improvement to alpha(), would you be making the same change/improvement to beta()?  If so, then by all means use a flag (eg. set to "alpha" or "beta") so that you get more mileage from only having to make future changes to one subroutine rather than two.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/