'morning.

This will work, although I question its elegance:

my $TEST_MODE = 1;
sub POE::Kernel::ASSERT_STATES() { 1 if $main::TEST_MODE }

(assuming this is in main and stuff...)

-a

At 11:41 AM 3/18/2002 -0500, Dan McCormick wrote:
>Howdy,
>
>This is more of a Perl question, but since it's POE-related...
>
>How do you conditionally turn on something like ASSERT_STATES?
>
>I'd like to do something like...
>
>if ($TEST_MODE) {
>   sub POE::Kernel::ASSERT_STATES () { 1 }
>}
>use POE;
>
>.... but of course the subroutine gets compiled regardless of $TEST_MODE.
>
>Is there a trick around this?
>
>Thanks,
>Dan

Reply via email to