httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas <s...@stason.org>
Subject Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfigPerl.pm
Date Sun, 16 Sep 2001 04:09:05 GMT
Doug MacEachern wrote:

> On Sun, 16 Sep 2001, Stas wrote:
>  
> 
>>Hmm, we don't want to pass the package name to the package itself
>>
> 
> why not?


because we know the package name anyway inside that package. :) 

>>this fixes it, so we can write:
>>
>>  sub APACHE_TEST_CONFIG {
>>      my $self = shift;
>>
> 
> this seems fine to me:
>     my($class, $config) = @_;


and what's the user of $class? When you can access it via __PACKAGE__ 
and you don't really need it anyway.


> 
>>-            eval { $module->APACHE_TEST_CONFIGURE($self); };
>>+            no strict 'refs';
>>+            eval { "${module}::APACHE_TEST_CONFIGURE"->($self) };
>>
> 
> this way passes use strict:
> 
> my $cv = \&{"${module}::APACHE_TEST_CONFIGURE"};
> eval { $cv->($self) };


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 $@;
         }

 
> 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.



-- 


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Mime
View raw message