On Sat, 28 Jul 2001, Michael G Schwern wrote:
>
> Unfortunately, I discovered a problem. Consider...
>
> {
> local $TODO = 'Fix off by one';
> package Foo;
> ok( ... );
> }
>
> Since ok() wil have to check ${caller.'::TODO'} you can't switch
> packages inside the TODO block. This might seem an odd thing to do,
Wait a minute. That shouldn't work at all. It should complain about
"Undefined subroutine &Foo::ok called at ...", since ok() has not been
exported to package Foo.
And the "solution" seems obvious too. Export $TODO, so that it gets
aliased to every package where ok() is available.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"You know why psych experimenters often use grad students as subjects,
right? It's because you have to feed lab rats, there are people
politically concerned with the lab rats' welfare, and there are some
things that lab rats won't do." -- Charles Martin in r.a.sf.s