1 | package Devel::FindRef; |
1 | package Devel::FindRef; |
2 | |
2 | |
3 | no warnings; # I hate warning nazis |
3 | use common::sense; |
4 | use strict; |
|
|
5 | |
4 | |
6 | use XSLoader; |
5 | use XSLoader; |
7 | use Scalar::Util; |
6 | use Scalar::Util; |
8 | |
7 | |
9 | BEGIN { |
8 | BEGIN { |
10 | our $VERSION = '1.421'; |
9 | our $VERSION = '1.422'; |
11 | XSLoader::load __PACKAGE__, $VERSION; |
10 | XSLoader::load __PACKAGE__, $VERSION; |
12 | } |
11 | } |
13 | |
12 | |
14 | =head1 NAME |
13 | =head1 NAME |
15 | |
14 | |
… | |
… | |
60 | The output is as follows (or similar to this, in case I forget to update |
59 | The output is as follows (or similar to this, in case I forget to update |
61 | the manpage after some changes): |
60 | the manpage after some changes): |
62 | |
61 | |
63 | SCALAR(0x7cc888) [refcount 6] is |
62 | SCALAR(0x7cc888) [refcount 6] is |
64 | +- referenced by REF(0x8abcc8) [refcount 1], which is |
63 | +- referenced by REF(0x8abcc8) [refcount 1], which is |
65 | | in the lexical '$closure_var' in CODE(0x8abc50) [refcount 4], which is |
64 | | the lexical '$closure_var' in CODE(0x8abc50) [refcount 4], which is |
66 | | +- the closure created at tst:18. |
65 | | +- the closure created at tst:18. |
67 | | +- referenced by REF(0x7d3c58) [refcount 1], which is |
66 | | +- referenced by REF(0x7d3c58) [refcount 1], which is |
68 | | | in the lexical '$closure' in CODE(0x7ae530) [refcount 2], which is |
67 | | | the lexical '$closure' in CODE(0x7ae530) [refcount 2], which is |
69 | | | +- the containing scope for CODE(0x8ab430) [refcount 3], which is |
68 | | | +- the containing scope for CODE(0x8ab430) [refcount 3], which is |
70 | | | | in the global &Test::testsub. |
69 | | | | the global &Test::testsub. |
71 | | | +- the main body of the program. |
70 | | | +- the main body of the program. |
72 | | +- in the lexical '&' in CODE(0x7ae530) [refcount 2], which was seen before. |
71 | | +- the lexical '&' in CODE(0x7ae530) [refcount 2], which was seen before. |
73 | +- referenced by REF(0x7cc7c8) [refcount 1], which is |
72 | +- referenced by REF(0x7cc7c8) [refcount 1], which is |
74 | | in the lexical '$global_my' in CODE(0x7ae530) [refcount 2], which was seen before. |
73 | | the lexical '$global_my' in CODE(0x7ae530) [refcount 2], which was seen before. |
75 | +- in the global $Test::var. |
74 | +- the global $Test::var. |
76 | +- referenced by REF(0x7cc558) [refcount 1], which is |
75 | +- referenced by REF(0x7cc558) [refcount 1], which is |
77 | | in the member 'ukukey2' of HASH(0x7ae140) [refcount 2], which is |
76 | | the member 'ukukey2' of HASH(0x7ae140) [refcount 2], which is |
78 | | +- referenced by REF(0x8abad0) [refcount 1], which is |
77 | | +- referenced by REF(0x8abad0) [refcount 1], which is |
79 | | | in the lexical '$testsub_local' in CODE(0x8ab430) [refcount 3], which was seen before. |
78 | | | the lexical '$testsub_local' in CODE(0x8ab430) [refcount 3], which was seen before. |
80 | | +- referenced by REF(0x8ab4f0) [refcount 1], which is |
79 | | +- referenced by REF(0x8ab4f0) [refcount 1], which is |
81 | | in the global $Test::global_hashref. |
80 | | the global $Test::global_hashref. |
82 | +- referenced by REF(0x7ae518) [refcount 1], which is |
81 | +- referenced by REF(0x7ae518) [refcount 1], which is |
83 | | in the member 'ukukey' of HASH(0x7d3bb0) [refcount 1], which is |
82 | | the member 'ukukey' of HASH(0x7d3bb0) [refcount 1], which is |
84 | | in the global %Test::global_hash. |
83 | | the global %Test::global_hash. |
85 | +- referenced by REF(0x7ae2f0) [refcount 1], which is |
84 | +- referenced by REF(0x7ae2f0) [refcount 1], which is |
86 | a temporary on the stack. |
85 | a temporary on the stack. |
87 | |
86 | |
88 | It is a bit convoluted to read, but basically it says that the value |
87 | It is a bit convoluted to read, but basically it says that the value |
89 | stored in C<$var> is referenced by: |
88 | stored in C<$var> is referenced by: |