There's more than one way to do things | |
PerlMonks |
Re: Re: Re: Re: Execution order of END/CHECK vs BEGIN/INITby belden (Friar) |
on Jun 27, 2003 at 23:58 UTC ( [id://269776]=note: print w/replies, xml ) | Need Help?? |
With apologies, because I'm sure my question has already been answered but I'm too dense to recognize that fact... :) If module A "uses" module B, then you want module A's BEGIN block to run before modules B's BEGIN block. When cleanup happens, you want module B's END block to run before module A's END block. Given these modules
If I read your post correctly, you're saying that I want module B's END block to run before module A's END block. If this is what I wanted, I think I'd be disappointed: A use's B, which means that 'use B' in A causes us to fully parse B before finishing parsing A. Therefore, B's END block is loaded before A's END block. This makes A's END block Last In, thereby First Out. The truth is, I actually don't care in which order ENDs and CHECKs get called. I just want to know why BEGIN/INIT are FIFO and END/CHECK are LIFO. blymansetenv EXINIT 'set noai ts=2'
In Section
Seekers of Perl Wisdom
|
|