… | |
… | |
78 | |
78 | |
79 | =item - in the hash element C<ukukey2>, in the hash in the my variable |
79 | =item - in the hash element C<ukukey2>, in the hash in the my variable |
80 | C<$local> in the sub C<Test::testsub> and also in the hash referenced by |
80 | C<$local> in the sub C<Test::testsub> and also in the hash referenced by |
81 | C<$Test::hash2>. |
81 | C<$Test::hash2>. |
82 | |
82 | |
|
|
83 | =back |
|
|
84 | |
83 | =head1 EXPORTS |
85 | =head1 EXPORTS |
84 | |
86 | |
85 | None. |
87 | None. |
86 | |
88 | |
87 | =head1 FUNCTIONS |
89 | =head1 FUNCTIONS |
… | |
… | |
100 | |
102 | |
101 | sub find($); |
103 | sub find($); |
102 | |
104 | |
103 | sub track { |
105 | sub track { |
104 | my $buf = ""; |
106 | my $buf = ""; |
|
|
107 | my %ignore; |
105 | |
108 | |
106 | my $track; $track = sub { |
109 | my $track; $track = sub { |
107 | my (undef, $depth, $indent) = @_; |
110 | my ($target, $depth, $indent) = @_; |
|
|
111 | @_ = (); |
|
|
112 | local $ignore{$target+0} = undef; |
108 | |
113 | |
109 | if ($depth) { |
114 | if ($depth) { |
110 | my (@about) = find $_[0]; |
115 | my (@about) = grep !exists $ignore{$_->[1]}, find $target; |
111 | if (@about) { |
116 | if (@about) { |
|
|
117 | local @ignore{map $_->[1]+0, @about} = (); |
112 | for my $about (@about) { |
118 | for my $about (@about) { |
|
|
119 | local $ignore{$about+0} = undef; |
113 | $buf .= (" ") x $indent; |
120 | $buf .= (" ") x $indent; |
114 | $buf .= $about->[0]; |
121 | $buf .= $about->[0]; |
115 | if (@$about > 1) { |
122 | if (@$about > 1) { |
116 | $buf .= " $about->[1], which is\n"; |
123 | $buf .= " $about->[1], which is\n"; |
117 | $track->($about->[1], $depth - 1, $indent + 1); |
124 | $track->($about->[1], $depth - 1, $indent + 1); |
… | |
… | |
146 | |
153 | |
147 | =cut |
154 | =cut |
148 | |
155 | |
149 | sub find($) { |
156 | sub find($) { |
150 | my ($about, $excl) = &find_; |
157 | my ($about, $excl) = &find_; |
151 | my %excl = map +($_ => 1), @$excl; |
158 | my %excl = map +($_ => undef), @$excl; |
152 | grep !$excl{$_->[1] + 0}, @$about |
159 | grep !exists $excl{$_->[1] + 0}, @$about |
153 | } |
160 | } |
154 | |
161 | |
155 | =item $ref = Devel::FindRef::ref2ptr $ptr |
162 | =item $ref = Devel::FindRef::ref2ptr $ptr |
156 | |
163 | |
157 | Sometimes you know (from debugging output) the address of a perl scalar |
164 | Sometimes you know (from debugging output) the address of a perl scalar |