Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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

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.


In reply to B::Xref buggy? by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (4)
    As of 2019-08-24 20:21 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?