On 23-Jun-2008 Alejandro Imass wrote:
> The point was that this check was in two places in the same code. In one
> he uses /[^A-Z]/ and later in the map method he uses /[a-z]$/ ; they
> seem to be checking for the same thing. My suggestion is to ONLY discard
> all caps methods with:
> 
> unless( $method =~ /[^_A-Z]/ ){
>     croak ...
> 
> 
> ONLY in the AUTOLOAD sub, and get rid of the later check in the map sub.

I was thinking the other way around.  Because AUTOLOAD also checks the map
that was vetted by by __method_map() in some cases.  In the other cases, the
map was explicitly specified by the user, so everything should be valid.

Could you take a look at this :

http://pied.nu/Perl/POE-Component-Generic-0.1101.tar.gz 

It removes the uppercase check from AUTOLOAD and includes the __is_method_name()
method that you may overload at your pleasure.

-Philip

Reply via email to