in reply to Perl 5.10.1 versus 5.8.8 with $#{}
First off, don't use the variables $a or $b, as those are used by the sort function.
Secondly, observe the following code to differentiate how to obtain the last array index versus the length from an array reference.
-Millermy $arrayref = [10,11,12,13,14,15]; print "Last Index is: " . $#$arrayref . "\n"; print "Count of arraay is: " . scalar(@$arrayref) . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl 5.10.1 versus 5.8.8 with $#{}
by educated_foo (Vicar) on Feb 02, 2011 at 00:27 UTC | |
by wind (Priest) on Feb 02, 2011 at 01:08 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |