Well, RFC 23 doesn't mention ^0, and has several examples starting at ^1. And
it draws the analogy between ^1, ^2, etc and $1, $2, etc. I didn't make it up.
So I don't think you're being consistent here. Neither do I consider it an
improvement to add ^0.
While the positional placeholders may well select elements from an array, they
are themselves neither an array nor the indices; they could start with ^17 if
one so chose. But since they are countable items, the first best starting point
is with ^1. Let the computer subtract 1 when it does the indexing, not the
people.
That said, I'm sure I could learn to start at ^17, or even ^0, if the starting
point were documented at either of those.
> > I note your use of ^0 and ^1 where I and another poster both used
> > ^1 & ^2. I wonder how many people will have to learn about ^0 if
> > you implement it as a positional placeholder. Note that regexp
> > produces $1, $2 ..., not $0. And people really do count from 1,
> > until they've been indoctinated that computer arrays start at 0.
> > But placeholders are not an array.
>
> No indeed. They are short-hand for indexing operations into an array (@_).
> And array indices *do* start from zero.
>
> In contexts like this (and others such as C<grep>) the omission of ^0
> from a comparator would surely evoke a diagnostic.
>
> Damian
--
Glenn
=====
There are two kinds of people, those
who finish what they start, and so
on... -- Robert Byrne
_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html