These two threads might be of interest:
In reply to Re: Just before subroutine returns by haukex in thread Just before subroutine returns by solegaonkar