develooper Front page | perl.qa | Postings from April 2012

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

Thread Previous | Thread Next
From:
Paul Johnson
Date:
April 10, 2012 14:21
Subject:
Re: Revert use_ok() change to allow lexical effects?
Message ID:
20120410212051.GB28235@pjcj.net
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 - paul@pjcj.net
http://www.pjcj.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About