Nicholas Clark wrote:

$1 is a prime example. $0 means the program name (all scopes). $1 is the
first match.  It's been that way for a very, very, very long time, and
it works just great. There is no *compelling* reason to change this,
other than to satisfy a few people that think it "should be different".

I cannot agree. The reason you give is not "compelling".

On the contrary, doing things "the established way" is perhaps THE most
compelling reason. After all, we're changing to "." for objects to be
like Java and other languages, right? EVERY other language (including
Perl 5) starts with $1 (or \1).

Neither is the more
important reason, that it regularises the numbers when using an
array lookup to find matches, $1 being $/[1], IIRC.

If you could provide a real-world example where this helps, I'd
appreciate it. Again, I'm being sincere. I have never run into this
issue personally, so I'm trying to understand the benefit.


Reply via email to