in reply to Garbage collection at subroutine return
sub DoIt { return; } [download]
If this is not what you want you'll have to explain what you want in a bit more detail.