[32735] in Perl-Users-Digest
Perl-Users Digest, Issue: 3999 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 24 16:09:29 2013
Date: Wed, 24 Jul 2013 13:09:02 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 24 Jul 2013 Volume: 11 Number: 3999
Today's topics:
Re: names, values, boxes and microchips <rweikusat@mssgmbh.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 24 Jul 2013 11:23:17 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: names, values, boxes and microchips
Message-Id: <878v0wi7e2.fsf@sapphire.mobileactivedefense.com>
gamo@telecable.es writes:
>> __SUB__ A special token that returns a reference to the
>>current
>> subroutine,
>
> The OP wanted the name; will stringify(__SUB__) work?
> ------------------
>
> If Rainer wants a name, it is a ugly name, not a name for a pretty debug,
> but a name which I thinks is unique, and "could" be used
>
> $ perl -E 'sub a{ say (__SUB__); return 1; }; a();'
> CODE(0x8195c00)
The value in brackets is the 'pointer value' stored in the reference
object, cf
[rw@sapphire]~ $perl -MDevel::Peek -e '$s = sub {}; Dump($s); print($s, "\n")'
SV = RV(0x620c88) at 0x620c78
REFCNT = 1
FLAGS = (ROK)
RV = 0x620c90
SV = PVCV(0x623988) at 0x620c90
REFCNT = 2
FLAGS = (PADMY,ANON,WEAKOUTSIDE)
COMP_STASH = 0x605bb0 "main"
START = 0x629140 ===> 0
ROOT = 0x6291e0
GVGV::GV = 0x605e50 "main" :: "__ANON__"
FILE = "-e"
DEPTH = 0
FLAGS = 0x90
OUTSIDE_SEQ = 94
PADLIST = 0x620ca8
PADNAME = 0x620d38(0x6293d0) PAD = 0x620cf0(0x628e10)
OUTSIDE = 0x605fa0 (MAIN)
CODE(0x620c90)
This implies that it is meaningless outside of the context of the
process it came from and not necessarily unique: The same memory
location could be used to store a different subroutine at some other
time, at least in theory.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 3999
***************************************