httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <>
Subject Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache
Date Sun, 16 Sep 2001 17:16:17 GMT
On Sun, 16 Sep 2001, Stas wrote:
> and what's the user of $class? When you can access it via __PACKAGE__ 
> and you don't really need it anyway.

__PACKAGE__ is not helpful if one day a test .pm wants to inherit
APACHE_TEST_CONFIGURE from another class.  most of the Apache::Test* is
OO, so i am thinking that way here.

> I think this is even better, as can is already returning a ref to a sub 
> if found.
>          if (my $cv = $module->can('APACHE_TEST_CONFIGURE')) {
>              eval { $cv->($self) };
>              warn $@ if $@;
>          }

looks nicer yeah, but you shouldn't be looking up a method via @ISA if you
won't be calling it as a method.  (disclaimer: i think am guilty of having
done that in the past though)
> > but i think the current way in cvs is correct.
> true, it's correct. I just didn't want to add any data to the API, that
> you will never use. 

how do you know it will never be used?  its much easier to pass along that
little piece of data and let people ignore it than to try and retrofit
something the day somebody says they do need it.

View raw message