when you are calling several APIs in succession.
In my case, in particular the Win32 APIs. If you are getting data from one API and passing it to another, then to another, and so on, it does not make sense to keep converting between Perl and C for each API call. Just write the whole lot in C, call it once and return the final result.