Kai Henningsen <[EMAIL PROTECTED]> writes:

> That would be nice if the punctuation actually *were* part of the
> variable name.

> However, it isn't: to access 'second', you'd say $args[1], NOT @args[1].
> It's one of the Perl features that most confuses newcomers.

Well, I think it is; it's just that $args[1] is a different variable than
@args.  Maybe people think that's an odd notion of what a variable is, but
I think of @args as a collection containing a bunch of individual
variables, each of which has its own name that's disambiguated from $args
by [].  You can operate on the collection, or you can address the
variables individually.

This makes even more sense when you look at %args, and start looking at
multi-level hashes.

> If there's no better argument than this, I'd throw this distinction away
> in a heartbeat.

It's always easy to throw away other people's distinctions.  :)

> If the syntax can be changed so I never have to write @{some array ref}
> again to explain to perl that yes, I really want to use this array as an
> array, I'll be a happy man.

Now this I'll agree with; I find the @{ $$hash{value} } syntax rather
bletcherous.  But I think that's a separate problem and could well have a
separate solution.

Perhaps @->$$hash{value} as has been proposed before, and Perl 6 can deal
with the issue of the @- array in some other way.

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to