I agree with him! Is for humman abstraction. An array or string byte position need to start from 0 because if you want no manipulate it, mathematical you need to count from 0, or some counts can be wrong!

Note, $. is used for warnings outup too!

But the idea to count from 0 in the real life!!! No! ;-/

We count to say how many things we have, math star from here. 0 was created, and a big invention, to can count bigger amounts, but with the same symbols, and to represent the null too! If we count from 0, we need to invent another "0" symbol for null!

I say again, we count arrays from 0 only to manipulate it better. Is easier to make an algorithm that count from 0!For example, the subsrt() command:

substr($var , 0 , 2) ; substr($var , 2 , 2) ;
You use the 2 to say where the 1st substr ends and to say "where" the 2nd substr start! If we count from 1 you need to always recount the values for start and end:
substr($var , 1 , 2) ; substr($var , 3 , 2) ;

Graciliano M. P.
"The creativity is the expression of the liberty".


In reply to Re: Re: Why is $. not zero-based? (Why 0 based exist) by gmpassos
in thread Why is $. not zero-based? by Cody Pendant

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.