> How can I call the last element in the array?
use strict;
use warnings;

my @array = qw/ one two three /;
print $#array . "\n";
print $array[$#array] . "\n";


$#array gives you the last element. So my array has three elements but
counting starts at zero. so my last element is two.

Hope this helps.
Paul

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to