Perl itself exists as a DLL (I assume Windows since you said Delphi). The perl.exe we all know just loads that and calls it. You can load that DLL yourself. In C++ it's easy to override specific functions like what print() does, to work within your system. But you could start by seeing what's in that DLL and go from there.