Re: proposed addition to perlvar

[email protected] (The Sidhekin)
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
On Wed, Jun 9, 2010 at 5:51 PM, Chas. Owens <[email protected]> wrote:

> Perhaps changing
>
> C<$#> is also used as sigil, which, when prepended on the name of an
> array gives the index of the last element in that array.
>
> to
>
> C<$#> is still allowed to be used as sigil, which, when prepended on
> the name of an array gives the index of the last element in that array.
>
> would clear this up?
>

  It's not just symbolic ("name") use though:

sidhekin@blackbox[17:57:31]~$ perl -le 'print $#{[qw/a b c/]}'
2
sidhekin@blackbox[17:57:33]~$ perl -le 'print $#{\@ARGV}' a b c d
3
sidhekin@blackbox[17:57:35]~$


  Sweet, huh? :)


Eirik
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.