On 16 Aug 2000, Kai Henningsen wrote:
> > This is very Perlish to me; the punctuation is part of the variable name
> > and disambiguates nicely. I'd be very upset if this idiom went away.
>
> 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.
>
> If there's no better argument than this, I'd throw this distinction away
> in a heartbeat.
>
> 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.
Would @$obj->method make you happy? Is it just the braces that's the
problem?
$args[1] # one whutzit
@args[2..3] # more than one whutzits
@args # all whutzits
What's so complicated about that?
$hashish{'dog'} # one whutzit
@hashish{'dog', 'cat'} # more than one whutzits
each %hashish # one whutzit, indexed
%hashish # all whutzits, indexed
keys %hashish # all indices
values %hashish # all whutzits
(/me notes that we need a way to take an indexed slice... hmm)
I know I'm being terribly redundant, but the point I'm trying to make is
that the contextual clues (@$%) don't tell you what IT is, but what you're
getting from IT. That's what's so important.
Take this away and Perl becomes C.
int a;
struct b;
*cough* No, thank you.
--
Mike Pastore
[EMAIL PROTECTED]