in reply to Testing without linking to legacy codebase

Agreed with stevieb on mocking. My goto for this is Test::Mock::Guard. Basically you are replacing some method on a class or object with your own.

my $guard = mock_guard( $original_class, { GetDataFromOldSystem => sub {...}, }, ); $obj = $original_class->new(...); $obj->SomeOtherFunctionThatCalls_GetDataFromOldSystem(...);

Your provided sub would then return some pre-baked values instead of going to the original system.

--MidLifeXis