in reply to Re^4: Which phase am I in?
in thread Which phase am I in?
If the END doesn't need to be at the end of the program, why does the following give the wrong answer? I stand by what I said.
sub foo { print($__KLUDGE::phase eq 'END' ? 'END' : 'not END', $/); } # Needs to be at the beginning of the program to be reliable. BEGIN { $__KLUDGE::phase = 'BEGIN'; } # Needs to be at the end of the program to be reliable. END { $__KLUDGE::phase = 'END'; } # ... END { foo(); } # ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Which phase am I in?
by Crackers2 (Parson) on Nov 19, 2004 at 17:27 UTC | |
by ikegami (Patriarch) on Nov 19, 2004 at 17:31 UTC | |
by tilly (Archbishop) on Nov 19, 2004 at 19:57 UTC | |
by ikegami (Patriarch) on Nov 19, 2004 at 20:02 UTC | |
by tilly (Archbishop) on Nov 19, 2004 at 21:27 UTC |