in reply to What's in a Reference?
use Devel::Peek; my $x = 42; my $y = \$x; Dump $y; __END__ SV = RV(0x63fde0) at 0x604fc0 REFCNT = 1 FLAGS = (PADBUSY,PADMY,ROK) RV = 0x604fa0 <--- SV = IV(0x62de60) at 0x604fa0 REFCNT = 2 FLAGS = (PADBUSY,PADMY,IOK,pIOK) IV = 42
I'd call it an address. But in contrast to a C pointer, a Perl reference also maintains other info, and doesn't allow you to directly fiddle with the address.
(Note that the SV ... at 0x604fa0 is not part of the reference itself — Devel::Peek just dumps the referenced target, too, for convenience.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What's in a Reference?
by ikegami (Patriarch) on Jul 15, 2010 at 07:30 UTC | |
by almut (Canon) on Jul 15, 2010 at 07:40 UTC | |
by ikegami (Patriarch) on Jul 15, 2010 at 08:05 UTC | |
by Anonymous Monk on Jul 15, 2010 at 09:59 UTC |