Test::MockObject allows you to control interfaces for writing tests in perl. It can emulate interfaces that you normally would use (such as a database or other external items). You don't have to recreate the functionality, but simply mimic the input and output.