From: Dominic Dunlop Date: Tue, 12 Dec 2000 10:47:10 +0000 (+0100) Subject: Re: [ID 20001013.006] XS subs are not define()ed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=847c7ebe844d914694620789a161f1cb744b72d3;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20001013.006] XS subs are not define()ed Message-Id: Document how elusive subroutines can be. p4raw-id: //depot/perl@8112 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 06d3b1d..ed3f2dc 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -923,7 +923,10 @@ element to return happens to be C. You may also use C to check whether subroutine C<&func> has ever been defined. The return value is unaffected by any forward -declarations of C<&foo>. +declarations of C<&foo>. Note that a subroutine which is not defined +may still be callable: its package may have an C method that +makes it spring into existence the first time that it is called -- see +L. Use of C on aggregates (hashes and arrays) is deprecated. It used to report whether memory for that aggregate has ever been @@ -1479,7 +1482,10 @@ it exists, but the reverse doesn't necessarily hold true. Given an expression that specifies the name of a subroutine, returns true if the specified subroutine has ever been declared, even if it is undefined. Mentioning a subroutine name for exists or defined -does not count as declaring it. +does not count as declaring it. Note that a subroutine which does not +exist may still be callable: its package may have an C +method that makes it spring into existence the first time that it is +called -- see L. print "Exists\n" if exists &subroutine; print "Defined\n" if defined &subroutine;