in reply to Re^8: Which phase am I in?
in thread Which phase am I in?

So if your initialization and cleanup code are related,

They're not, at least not in the sense you mean. Read the thread. We can't use the normal case here. We want to set $phase as early as possible after BEGINs start being processed, and we want to set $phase as early as possible after ENDs start being processed. BEGIN is FIFO. END is LIFO. We want FO for both, so we need to put BEGIN as FI as possible, and the END as LI as possible.

Replies are listed 'Best First'.
Re^10: Which phase am I in?
by tilly (Archbishop) on Nov 19, 2004 at 21:27 UTC
    Ah, well in that case we could just crawl back with caller looking for calls to BEGIN or END to figure out which one we are in. Much more reliable than trying to arrange to have the very last END block inserted (particularly when we might load something that adds some more at any point).