in reply to exec with cleanup

Perhaps the cleanest solution would be the prosaic wrapper script -- have a script run first your first program, then your second program. All cleanup would of necessity be completed by your first program. The outer wrapper (gasp) doesn't even need to be perl, but could be shell or .bat or whatever is appropriate for your platform.
#!/bin/sh first_program args1 second_program args2

Alternatively, you could take advantage of the fact that END blocks are executed in the inverse order that they are defined, so if the very first END block your script encounters calls the exec, it will be the last bit of code run on cleanup. (see docs: http://www.perldoc.com/perl5.8.4/pod/perlmod.html#BEGIN%2c-CHECK%2c-INIT-and-END.



--JAS