> On Wed, Jan 02, 2002 at 05:37:28PM +0100, Mattia Barbon wrote:
> > I don't care for the variable name, but I'd really like
> > to have this feature.
> 
> Would it work ok as a Test::Builder accessor method rather than an
> environment variable?
No, unfortunately, because the call order is like this:
* init code in the backend
* BEGIN blocks of the program ( including use Foo; )
* B::Backend::compile
* the coderef returned by B::Backend::compile

So I can't call the method from the init code in the backend, because
Test::Builder hasn't been loaded yet, and calling it from the
::compile is too late ( output is already lost ); the alternative I see is to use a 
package variable; so I can set
$Test::Builder::i_want_the_output_even_if_dollar_caret_C_is_1 = 1;
in initialization code. But I rwally like the environment variable
better, because with the package variable solution I need to set it
unconditionally ( because for it to have effect it must be set in the init code, and 
in the init code I can't look at parameters, because parameters are passed in the 
call to compile, so I can't set it using a parameter ), and because I was hoping to 
keep B::C clear from
hacks-to-make-the-testsuite-happy.

Regards
Mattia

Reply via email to