develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24350] package base produces incorrect error messages

From:
Michael G Schwern
Date:
October 29, 2003 20:40
Subject:
Re: [perl #24350] package base produces incorrect error messages
Message ID:
20031030044004.GI1624@localhost.comcast.net
On Wed, Oct 29, 2003 at 10:32:21AM -0000, pkremer@spurious.biz (via RT) wrote:
> When trying to use a module as base package which does not exist,
> package base will bail out with the message:
> 
>   Base class package "MODULE::DOES::NOT::EXIST" is empty.
>   (Perhaps you need to 'use' the module which defines that package first.)
> 
> Code which leads to this error:
> 
>   use base 'MODULE::DOES::NOT::EXIST';
> 
> The error message should state:
> 
>    Can't locate MODULE/DOES/NOT/EXIST.pm in @INC ....

base.pm cannot assume that the base class maps to a real file.  Consider
the following.

    use base qw(Tie::StdHandle);

There is no Tie/StdHandle.pm.  Its (unfortunately) in Tie/Handle.pm.
With your patch the error message would be incorrect.


-- 
Michael G Schwern        schwern@pobox.com  http://www.pobox.com/~schwern/
If God made anything more guerrila than your breast, I hope he kept it for
your father.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About