To keep things organized, I'd use
Test::Class for this. The part about 'EXTENDING TEST CLASSES BY INHERITANCE' may be useful. Your shared code would subclass Test::Class and your tests would in turn subclass that. Depending on your tests, you may only need to provide
setup and
teardown methods in your actual test files.