Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.perl.misc > #8828
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
|---|---|
| Newsgroups | comp.lang.perl.misc |
| Subject | Re: names, values, boxes and microchips |
| Date | 2013-07-24 11:23 +0100 |
| Message-ID | <878v0wi7e2.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <51ee657b$4$fuzhry+tra$mr2ice@news.patriot.net> <ksmpua$snt$1@speranza.aioe.org> |
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.
Back to comp.lang.perl.misc | Previous | Next — Previous in thread | Next in thread | Find similar
names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-16 21:45 +0100
Re: names, values, boxes and microchips Ben Morrow <ben@morrow.me.uk> - 2013-07-19 17:07 +0100
Re: names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-19 17:38 +0100
Re: names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-19 19:28 +0100
Re: names, values, boxes and microchips Ben Morrow <ben@morrow.me.uk> - 2013-07-20 00:11 +0100
Re: names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-20 15:02 +0100
Re: names, values, boxes and microchips Ben Morrow <ben@morrow.me.uk> - 2013-07-20 16:45 +0100
Re: names, values, boxes and microchips Rainer Weikusat <rw@sapphire.mobileactivedefense.com> - 2013-07-21 11:15 +0100
Re: names, values, boxes and microchips gamo@telecable.es - 2013-07-21 12:47 +0000
Re: names, values, boxes and microchips Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid> - 2013-07-23 07:14 -0400
Re: names, values, boxes and microchips gamo@telecable.es - 2013-07-23 20:43 +0000
Re: names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-24 11:23 +0100
Re: names, values, boxes and microchips Ben Morrow <ben@morrow.me.uk> - 2013-07-23 23:10 +0100
Re: names, values, boxes and microchips Ben Morrow <ben@morrow.me.uk> - 2013-07-21 18:01 +0100
Re: names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-21 20:53 +0100
Re: names, values, boxes and microchips Ben Morrow <ben@morrow.me.uk> - 2013-07-21 22:51 +0100
Re: names, values, boxes and microchips Charles DeRykus <derykus@gmail.com> - 2013-07-21 16:29 -0700
Re: names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-22 01:20 +0100
Re: names, values, boxes and microchips Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-22 01:06 +0100
[OT] naming conventions Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-07-22 10:35 +0100
csiph-web