Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Thanks Dave.

I'm no expert on OP-Codes but that doesn't seem to be always the case.

On a simpler example the insides of while are parsed but the following line-number is wrong

(manually added #:markers)

D:\tmp>more tst_b_xref2.pl use strict; use warnings; my $sth; while ( my @row =$sth->fetchrow) { #:5 intro print "@row"; #:6 used }

activating debug options

D:\tmp>perl -MO=Xref,-r,-d,-DO tst_b_xref2.pl OP (0x163e650) enter COP (0x10fcdd8) nextstate OP (0x10fce38) padsv tst_b_xref2.pl (main) 3 (lexical) $ sth + intro COP (0x163e698) nextstate LOOP (0x163e740) enterloop OP (0x16579c8) pushmark OP (0x1657a50) pushmark PADOP (0x1657b48) gvsv tst_b_xref2.pl (main) 5 main $ " + used OP (0x1657ad0) padav tst_b_xref2.pl (main) 5 (lexical) @ row + used #:used? LISTOP (0x1657a88) join LISTOP (0x1657a08) print OP (0x163e870) unstack OP (0x1657bd0) pushmark OP (0x1657d60) pushmark OP (0x10fcd18) padsv tst_b_xref2.pl (main) 5 (lexical) $ sth + used METHOP (0x1657d18) method_named UNOP (0x1657cd0) entersub tst_b_xref2.pl (main) 5 (lexical) $ sth + subused OP (0x1657c50) pushmark OP (0x10fcd58) padav tst_b_xref2.pl (main) 5 (lexical) @ row + intro #:5?intro? BINOP (0x1657b88) aassign LOGOP (0x163e7e0) and BINOP (0x163e6f8) leaveloop LISTOP (0x10fcd90) leave tst_b_xref2.pl syntax OK

It's worth noting that B::Concise and B::Deparse are getting the line-numbers right:

D:\tmp>perl -MO=Concise,-src tst_b_xref2.pl n <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 # 3: my $sth; 2 <;> nextstate(main 3 tst_b_xref2.pl:3) v:*,&,{,x*,x&,x$,$ ->3 3 <0> padsv[$sth:3,9] vM/LVINTRO ->4 # 5: while ( my @row =$sth->fetchrow) { #: +line 5 4 <;> nextstate(main 4 tst_b_xref2.pl:5) v:*,&,{,x*,x&,x$,$ ->5 m <2> leaveloop vK/2 ->n 5 <{> enterloop(next->c last->m redo->6) v ->d - <1> null vK/1 ->m l <|> and(other->6) vK/1 ->m k <2> aassign[t4] sKS/COM_AGG ->l - <1> ex-list lK ->i d <0> pushmark s ->e h <1> entersub[t3] lKS/TARG,STRICT ->i e <0> pushmark s ->f f <0> padsv[$sth:3,9] sM ->g g <.> method_named[PV "fetchrow"] l ->h - <1> ex-list lK ->k i <0> pushmark s ->j j <0> padav[@row:5,8] lRM*/LVINTRO ->k #: +@row intro - <@> lineseq vK ->- - <@> scope vK ->c # 6: print "@row"; #: +line 6 - <;> ex-nextstate(main 7 tst_b_xref2.pl:6) v:*,&,x +*,x&,x$,$ ->6 b <@> print vK ->c 6 <0> pushmark s ->7 a <@> join[t6] sK/2 ->b 7 <0> pushmark s ->8 - <1> ex-rv2sv sK/STRICT,1 ->9 8 <#> gvsv[*"] s ->9 9 <0> padav[@row:5,8] l ->a #: +@row used c <0> unstack v ->d tst_b_xref2.pl syntax OK

So probably B::Xref is better implemented by extending B::Concise ?

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice


In reply to Re^4: B::Xref buggy? by LanX
in thread 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 scrutinizing the Monastery: (3)
    As of 2019-06-16 04:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Is there a future for codeless software?



      Results (76 votes). Check out past polls.

      Notices?