Hi
I'm not sure but it seems like B::Xref is buggy, after running perl -MO=Xref,-r,-d tst_b_xref.pl
with 5.24 Activestate on
D:\tmp>perl -c tst_b_xref.pl
tst_b_xref.pl syntax OK
D:\tmp>more tst_b_xref.pl
use strict;
my $sth;
my $lines;
while ( my @row = $sth->fetchrow_array ) { #5
print "@row.\n"; #7
push @{$lines},+{status => $row[0]}; #9
}
I'm getting
tst_b_xref.pl (main) 2 (lexical) $ sth
+ intro
tst_b_xref.pl (main) 2 (lexical) $ lines
+ intro
tst_b_xref.pl (main) 7 main $ "
+ used
tst_b_xref.pl (main) 7 (lexical) @ row
+ used
tst_b_xref.pl (main) 9 (lexical) $ lines
+ used
tst_b_xref.pl (main) 9 (lexical) @$ lines
+ used
tst_b_xref.pl (main) 9 (lexical) $ sth
+ used
tst_b_xref.pl (main) 9 (lexical) $ sth
+ subused
tst_b_xref.pl (main) 9 (lexical) @ row
+ intro
please note that @row was "intro"-duced in line 5 inside while and "used" in line 7 and
9,
But the output says used in 7 and introduced in 9, which doesn't really make sense.
(I'm taking no issues (yet) on the "$ sth subused" line which is reporting the ->fetchrow method call.)
update
Reproduced with 5.18 under Ubuntu
$ cat /tmp/xref.out
tst_b_xref.pl (main) 2 (lexical) $ sth
+ intro
tst_b_xref.pl (main) 3 (lexical) $ lines
+ intro
tst_b_xref.pl (main) 7 main $ "
+ used
tst_b_xref.pl (main) 7 (lexical) @ row
+ used
tst_b_xref.pl (main) 9 (lexical) $ lines
+ used
tst_b_xref.pl (main) 9 (lexical) @$ lines
+ used
tst_b_xref.pl (main) 9 (lexical) $ sth
+ used
tst_b_xref.pl (main) 9 (lexical) $ sth
+ subused
tst_b_xref.pl (main) 9 (lexical) @ row
+ intro
update
Added line numbers
update
Perl seems to optimise to my ($sth,$lines);', that's why '$lines is reported at line 2 not 3.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.