Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Refactoring copy-pasted code

by talexb (Chancellor)
on May 05, 2009 at 13:40 UTC ( [id://761934]=note: print w/replies, xml ) Need Help??


in reply to Refactoring copy-pasted code

I'm very happy using gvimdiff between two files to get visual feedback on what parts of the file are identical. And if you find that a bunch of the scripts are identical from lines 200-400, say, it should be possible to centralize those routines in a module.

Writing tests for this kind of script can be a challenge, but setting up some test data files with as many possible corner cases should go a long way to solving that.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://761934]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-20 15:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found