--Dks
$?SUBNAME, I think, unless &?SUB just stringifies to that. I guess
it's a good question whether &foo should stringify to "foo" or
"&foo" or something else including the signature. In which case,
&?SUB might stringify to a lot of info, and $?SUBNAME would more
reliably be just the short name. Maybe we also need a way to get
the long name explicitly.
Larry
LW> On Mon, Mar 07, 2005 at 09:49:04PM -0800, David Storrs wrote:
LW> : Is there a way to find the name of &?SUB ? It would be useful for
LW> : error-logging and -reporting.
LW> $?SUBNAME, I think, unless &?SUB just stringifies to that. I guess
LW> it's a good question whether &foo should stringify to "foo" or
LW> "&foo" or something else including the signature. In which case,
LW> &?SUB might stringify to a lot of info, and $?SUBNAME would more
LW> reliably be just the short name. Maybe we also need a way to get
LW> the long name explicitly.
why not leave it as $?SUB but it is an object and you use the .name
method? this way you won't clutter the namespace and you can add more
methods like .signature, .returns, etc.
uri
--
Uri Guttman ------ u...@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
LW> On Tue, Mar 08, 2005 at 01:55:07AM -0500, Uri Guttman wrote:
LW> : why not leave it as $?SUB but it is an object and you use the .name
LW> : method?
LW> Uh, yeah. Obviously, 11 pm is still to early in the day for me...
^^
or too late? :)
(i wouldn't normally spellcheck you but you are usually very accurate
and this must mean something)
and 2am is bedtime for me now.
LW> : this way you won't clutter the namespace and you can add more
LW> : methods like .signature, .returns, etc.
LW> In which case $?SUB and &?SUB are probably just different names for
LW> the same object, or we just go with &?SUB, and assume people will be
LW> able to figure out from the lack of parens that &?SUB.name is not
LW> calling the subroutine. Or I suppose we could go with straight $?SUB.
LW> Or both. Or one. Or the other. Or both. Or...
burble! i know how you feel. now slowly back away from the keyboard and
say nighty night to us all. we need a refreshed larry and not one who
pulls all nighters like some college kid (or damian :).
Uh, yeah. Obviously, 11 pm is still to early in the day for me...
: this way you won't clutter the namespace and you can add more
: methods like .signature, .returns, etc.
In which case $?SUB and &?SUB are probably just different names for
the same object, or we just go with &?SUB, and assume people will be
able to figure out from the lack of parens that &?SUB.name is not
calling the subroutine. Or I suppose we could go with straight $?SUB.
Or both. Or one. Or the other. Or both. Or...
Larry