If it is a command line application, you can use
Test::Cmd or
Test::Excpect. If it is a GUI, you can use
Win32::GuiTest on Windows and
X11::GUITest on Linux.
If you want to test the code, you could write XS-code that interacts with your C-Code. In the Perl script you can use the above mentioned modules for the TAP output.