Refactor/Rewrite Perl code in Python

Chris Angelico rosuav at gmail.com
Sun Jul 24 05:45:11 EDT 2011


On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand
<anand.shashwat at gmail.com> wrote:
> How do I start ?
> The idea is to rewrite module by module.
> But how to make sure code doesn't break ?
> How can I import perl and python codes in each other ?

Can you separate the project into separate executables that call on
each other? You can pipe text from stdout of perl to stdin of python,
for instance. Otherwise, it's not going to be easy. But if you're
going to change the underlying database AND the code at the same time,
it may be best to simply set aside the old code completely and code a
brand new system in Python, capitalizing on the Second Mouse Effect
(the early bird gets the worm, but the second mouse gets the cheese).
You can learn from all the mistakes made in the first version,
allowing you to make an entirely new set of mistakes. :)

ChrisA



More information about the Python-list mailing list