Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

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

I was aware that OPs do kind of gotos to next-OPs (the ->label at the end of each line).

But it didn't seem logical that the -src option could be offered if B::Concise wasn't respecting the order.*

The solution is that the source lines they are not in order, but the line numbers are still reliable:

D:\tmp>type tst_b_xref3.pl unless ($var1) { $var2++; } else { $var3++; }
(Win Activestate 5.24)
D:\tmp>perl -MO=Concise,-src tst_b_xref3.pl|find "var" tst_b_xref3.pl syntax OK # 1: unless ($var1) { 3 <#> gvsv[*var1] s ->4 # 5: $var3++; 7 <#> gvsv[*var3] s ->8 # 2: $var2++; d <#> gvsv[*var2] s ->e

So strictly speaking it's still possible to use B::Concise to emulate B::Xref on line number level.

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

*) Interestingly this also depends on the Perl version. Here the vars appear in order: (Ubuntu 5.18)

$ perl -MO=Concise,-src tst_b_xref3.pl|grep var tst_b_xref3.pl syntax OK # 1: unless ($var1) { 3 <#> gvsv[*var1] s ->4 # 2: $var2++; 8 <#> gvsv[*var2] s ->9 # 5: $var3++; e <#> gvsv[*var3] s ->f

update

and that's the reason why, 5.24 is optimizing the negation away by swapping the branches:

D:\tmp>perl -MO=Deparse tst_b_xref3.pl tst_b_xref3.pl syntax OK if ($var1) { ++$var3; } else { ++$var2; }

In reply to Re^10: 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":



  • 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.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-16 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found