
FishMonger
Veteran
Aug 21, 2012, 1:55 PM
Views: 2811
|
|
Re: [jazzo] insert numbers in array using standard input
|
|
|
-1 is used when specifying/accessing the last element in the array. It has nothing to do with the length (or size) of the array.
my @array = qw|first second third fourth fifth|; print $array[-1]; # prints fifth print $array[-2]; # prints fourth print $array[-3]; # prints third
(This post was edited by FishMonger on Aug 21, 2012, 1:55 PM)
|