[EMAIL PROTECTED] (Russ Allbery)  wrote on 15.08.00 in 
<[EMAIL PROTECTED]>:

> > All variables should be C<$x>. They should behave appropriately
> > according to their object types and methods.
>
> No thanks.  I frequently use variables $foo, @foo, and %foo at the same
> time when they contain the same information in different formats.  For
> example:
>
>     $args = 'first second third';
>     @args = split (' ', $args);
>     my $i = 0;
>     %args = map { $_ => ++$i } @args;
>
> 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.

MfG Kai

Reply via email to