On 5/8/05, amr wrote:
> How can I call the last element in the array?
> 
> I try the pop and it does the job but I think there is another way?
> 

if the array is called "@array", the last element can be called either using:
$array[$#array]
or
$array[-1]

Read:
http://perldoc.perl.org/perldata.html (everything about Perl data types)
http://perldoc.perl.org/perlintro.html (Perl Introduction - a great
beginner resource)

You can also read these from your command-line using the "perldoc"
command. Try "perldoc perl".

HTH,
-- 
Offer Kaye

--
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