in reply to Re: strange syntax
in thread strange syntax
The documentation explains it: perldata ... search for $#
Let see what all explain it [perldoc://"$#"] "$#" -> perlref $aref->$#*; # same as $#{ $aref }
Wow, what a horrible search engine, that it five pages of results
[ddg://"$#" site:perldoc.perl.org] "$#" site:perldoc.perl.org -> more of same nonsense, wow
hello http://grep.cpan.me/?q=\%24%23\w%2B+dist%3Aperl+ ->
The Perl equivalent for this is C<$#myarray>. Set the highest index in the array to the given number, equivalent to Perl's C<$#array = $fill;>. RJ
hello http://grep.cpan.me/?q=\%24%23\w%2B%20dist%3Aperl%20+dist=perl
trigger for I<container magics>, i.e. it will for C<%ENV> or C<%SIG> but not for C<$#array>. perl-5.22.0/pod/perldata.pod $days{'Feb'} # the 'Feb' value from hash %days $#days # the last index of array @days The length of an array is a scalar value. You may find the length of array @days by evaluating C<$#days>, as in B<csh>. However, this isn't the length of the array; it's the subscript of the last elemen which is a different value since there is ordinarily a 0th element. Assigning to C<$#days> actually changes the length of the array. Shortening an array this way destroys intervening values
pod/perldata.pod 53: $#days # the last index of array @days 357:of array @days by evaluating C<$#days>, as in B<csh>. However, th +is 360:Assigning to C<$#days> actually changes the length of the array. 364:X<$#> X<array, length> 373: $#whatever = -1; 382: scalar(@whatever) == $#whatever + 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: strange syntax (more ways to search for and find docs, grep.cpan.me)
by AnomalousMonk (Archbishop) on Jun 17, 2015 at 02:38 UTC | |
by Anonymous Monk on Jun 17, 2015 at 07:46 UTC |