develooper Front page | perl.perl5.porters | Postings from August 2001

Re: 'can' with undefined subs

Thread Previous | Thread Next
From:
Hugo van der Sanden
Date:
August 18, 2001 09:34
Subject:
Re: 'can' with undefined subs
Message ID:
200108181633.f7IGX1j25559@crypt.compulink.co.uk
Tony Bowden <tony@kasei.com> wrote:
:> I think that's really down to the user not to declare a sub without
:> providing an implementation - "Undefined subroutine &Foo::bar called"
:> is about as helpful as we can be at that point.
:
:My main concern here is that UserA, who uses the module, may not be the
:same as UserB, who wrote it.

I think eval is the answer to that one.

:> :It also doesn't seem to be documented anywhere.
:> Patches welcome, as always. You may well find that we are deficient
:> on tests for this behaviour as well. :)
:
:I'll try to find the best place to document it. Suggestions welcome.
:Where should the test live?

I'd guess comp/decl.t and/or comp/proto.t. Be a bit careful though -
since comp/* tests appear so early in the test suite, it is preferable
to avoid using complex code.

Hugo

Thread Previous | Thread Next


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