LanX has asked for the wisdom of the Perl Monks concerning the following question:
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
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
update
Added line numbers
update
Perl seems to optimise to my ($sth,$lines);', that's why '$lines is reported at line 2 not 3.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: B::Xref buggy?
by dave_the_m (Monsignor) on Nov 15, 2018 at 11:58 UTC | |
by LanX (Saint) on Nov 15, 2018 at 12:50 UTC | |
by dave_the_m (Monsignor) on Nov 15, 2018 at 14:56 UTC | |
by LanX (Saint) on Nov 15, 2018 at 15:18 UTC | |
by dave_the_m (Monsignor) on Nov 15, 2018 at 15:52 UTC | |
| |
by ikegami (Patriarch) on Nov 16, 2018 at 20:12 UTC | |
| |
Re: B::Xref buggy?
by ikegami (Patriarch) on Nov 16, 2018 at 20:57 UTC |