Re: Revert use_ok() change to allow lexical effects?

Paul Johnson <[email protected]>
Newsgroups gmane.comp.lang.perl.quality-assurance
Message-ID <[email protected]>
On Tue, Apr 10, 2012 at 12:20:20PM -0700, Michael G Schwern wrote:
> In a series of patches, Father Chrysostomos and I enhanced use_ok() so that it
> can apply lexical effects to more closely emulate the real `use`.

> There are two questions:
> 
> 1. Should the lexical effect patches to use_ok() be rolled back?

I'm slightly in favour of this.

> 2. Should use_ok() be discouraged in the documentation?

I'm very much in favour of this.

> The new use_ok(), while it works remarkably well, is significantly more
> complex than previously and it touches magical variables $^H and %^H.  There
> is a danger of invoking bugs by touching those variables.

I still appreciate Joshua Pritikin's parenthetical comment in the
original Test.pm:

  Your test code should be simpler than the code it is testing, yes?

> Apologies to Father Chrysostomos if his work is reverted, it has been top
> notch.  If it is reverted, it may find life in another module where a complete
> emulation of use is desired as a user function or method.

It might be nice to take the enhanced use_ok code out completely and put
it into its own module.

Yeah, I know.

-- 
Paul Johnson - [email protected]
http://www.pjcj.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.