ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Devel-FindRef/FindRef.pm
(Generate patch)

Comparing Devel-FindRef/FindRef.pm (file contents):
Revision 1.10 by root, Sat Apr 26 03:15:28 2008 UTC vs.
Revision 1.11 by root, Fri Jul 11 17:59:19 2008 UTC

107sub track { 107sub track {
108 my ($ref, $depth) = @_; 108 my ($ref, $depth) = @_;
109 @_ = (); 109 @_ = ();
110 110
111 my $buf = ""; 111 my $buf = "";
112 my %seen;
112 113
113 Scalar::Util::weaken $ref; 114 Scalar::Util::weaken $ref;
114 115
115 my $track; $track = sub { 116 my $track; $track = sub {
116 my ($refref, $depth, $indent) = @_; 117 my ($refref, $depth, $indent) = @_;
120 if (@about) { 121 if (@about) {
121 for my $about (@about) { 122 for my $about (@about) {
122 $buf .= (" ") x $indent; 123 $buf .= (" ") x $indent;
123 $buf .= $about->[0]; 124 $buf .= $about->[0];
124 if (@$about > 1) { 125 if (@$about > 1) {
126 if ($seen{$about->[1]+0}++) {
127 $buf .= " $about->[1], which was seen before.\n";
128 } else {
125 $buf .= " $about->[1], which is\n"; 129 $buf .= " $about->[1], which is\n";
126 $track->(\$about->[1], $depth - 1, $indent + 1); 130 $track->(\$about->[1], $depth - 1, $indent + 1);
131 }
127 } else { 132 } else {
128 $buf .= ".\n"; 133 $buf .= ".\n";
129 } 134 }
130 } 135 }
131 } else { 136 } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines