Adam Spiers <[EMAIL PROTECTED]> writes:
> Piers Cawley ([EMAIL PROTECTED]) wrote:
> > Adam Spiers <[EMAIL PROTECTED]> writes:
> > > If we're really concerned about not importing anything, we can
> > > always use the
> > > 
> > >   use Foo ();
> > > 
> > > form.
> > 
> > That still means that 'import' could get run. Which is definitely not
> > doing the Right thing.
> 
> Hmm, true.  I'd basically ditched the use of `require' because it
> reminded me of obselete Perl4-isms, and because pretty much all modern
> code I've seen does the same.
> 
> > > and what type of class file would want to export stuff anyway? 
> > 
> > A stupid one.
> 
> Precisely, which is why I didn't consider using `use' a problem.  What
> about the compile-time vs. run-time issues?  Are there any pros/cons?
> One con is maybe that perl -cw could miss syntax errors in required
> modules?

Hmm... good point. 

[Further Hmmm...] It seems (on reading the docs) that 

   use Module ();

is exactly equivalent to

   BEGIN { require Module }

which removes my objection to it. And gets us compile time checking. 

Note that, in the places where compile time loading is (potentially)
really important, we should be using 'use base qw(Parent)', which will
DTRT at compile time.

Actually, to take advantage of any possible OO dispatch gains when
Perl6 happens, we should probably be peppering our code with 'my Dog
$spot' type constructions right now (there's a slight performance
*penalty* now, but come Perl 6 we should get a larger performance gain
and (possibly) some nice runtime exceptions thrown when the wrong sort
of object gets passed...)

> 
> > > We've done that everywhere else in the code, 
> > 
> > You've been doing it wrong everywhere else in the code then.
> 
> That was other guys ;-)

Why is it that, whenever I express something with such certainty I
inevitably find out I'm wrong?

-- 
Piers


_______________________________________________
Perlunit-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/perlunit-devel

Reply via email to