> As a solution, a UNIVERSAL:::require() method can be added with the following
> syntax:
> 
>     $module = "Some::Module";
>     $module->require;

Seems to me that it would need to be written as

        $module->UNIVERSAL::require;

How do you propose to avoid that?



> What should happen if UNIVERSAL::require() is called as an object method? 
> Should it C<eval "require ".ref $obj> or should it be an error?  Because the
> situation is very rare when you will have an object from a class which has not
> yet been required, UNIVERSAL::require() should only work as a class method. 
> C<$obj->require> should be an explicit run-time error.

No.  Any reason not to let the error arising from C<eval "require ".ref $obj>
to do its normal thing?

The case may be rare, but it should be allowed: UNIVERSAL::require() should
DTRT given an object ref.

-- 
John Porter

        We're building the house of the future together.

Reply via email to