Seems to be perfectly defined for this purpose.

STRLEN is used for variables whose value will passed to the last argument of memcpy and for those that will receive the result of strlen. I don't see why it would be more suitable to use a different type than the actual type the functions use.

The problem is, as you pointed out above, size_t, (actually defined as what sizeof() returns), is an unsigned type, and therefore cannot handle negative indexing.

It does not need to handle negative indexing. The position and length are normalised before being stored into STRLEN vars, and the IV vars in which they stored as they are being normalised can already handle negative numbers. Putting the position and length into signed STRLEN vars instead of (signed) IV vars is not going to help simplify pp_substr any.

There are three ways of simplifying pp_substr:


In reply to Re^7: [OT] LLP64 .v. LP64 portability by ikegami
in thread [OT] LLP64 .v. LP64 portability by BrowserUk

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, details, 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, summary, 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.