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

Comment on

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

True, but the extra opcode (length) imposes a 30% hit.

Of course that diminishes if you're doing anything useful within the loop, but it is still significant for those situations where using such an obscure mechanism is worth considering.

Luckily, genomic data doesn't usually contain zeros or nulls.

I think it would be really nice if in the same way that in 5.12 you can use each on arrays, it would be nice to use it on scalars:

my $string = 'fred'; my( $i, $c ); say "$i:$c" while ($i,$c) = each $string; 0:f 1:r 2:e 3:d say while $_ = each $string; f r e d

I think that could be made very efficient by aliasing a LvTARG to the characters in situ; and would be very useful.

IMO far more useful than the single character saving of each $arrayRef; over each @$arrayRef, which unfortunately probably means that it could not now be implemented :(

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: Efficient walk/iterate along a string by BrowserUk
in thread Efficient walk/iterate along a string by gje21c

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?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (6)
    As of 2018-04-23 18:25 GMT
    Find Nodes?
      Voting Booth?