Re: URI::URL
Tim Bunce (Tim.Bunce@ig.co.uk)
Tue, 11 Jul 1995 20:45:19 +0100
> From: Gisle Aas <aas@oslonett.no>
>
> Consider this:
>
> $url = new URI::URL "http://www.oslonett.no/";
> $url->print_on;
>
> when I run this script I get the following message:
> Undefined subroutine &URI::URL::_generic::print_on called at ./utest line 6.
>
> If I comment out the "*{"dump"} = \&print_on;" at line 1115 in URI::URL, then
> things work as it should. The code around line 1115 is:
>
> # Aliases for old method names. To be deleted in a future version.
> { package URI::URL::_generic;
> *{"dump"} = \&print_on;
>
> What is going on? (I use perl5.001m and URI::URL 2.11)
I think print_on used to be defined in the URI::URL::_generic package.
The dump alias would therefore be correctly setup to refer to print_on.
At a later date print_on moved up to URI::URL. Now the act of saying
"package URI::URL::_generic; ...=\&print_on;" creates an undefined stub.
The stub intercepts the method lookup hence the error.
I'd just delete that block. It's time has passed.
> Gisle Aas <aas@oslonett.no>
> Oslonett AS http://www.oslonett.no/home/aas/
>
Tim.