[plug] [Perl] Hello gurus

John Usher John.Usher at perth.maptek.com.au
Fri Jan 3 15:48:58 WST 2003


$#test is the array location of the last scalar in the array. Ie
'$#test+1' = length of the array - also found with 'scalar @test'.

Thus $test[$#test-1] will return you the second last element in the
array (as long as there are more than 1 scalars in the array ($#test>0).

J.

-----Original Message-----
From: Patrick Tehvand [mailto:patrick at perthix.net] 
Sent: Friday, 3 January 2003 8:56 AM
To: plug at plug.linux.org.au
Subject: [plug] [Perl] Hello gurus


Guys,

I think that for array:  @test  , $#test would indicate the last scalar
(ie 
@test[last number]in the array. (please correct me if i am wrong there)

Id there a way I can indicate the 2nd last scalar in the array?

Cheers oh mighty Perl gods.

-- 
Patrick Tehvand
Acolyte of Perl


_____________________________________________________________________
This e-mail is brought to you 100% virus free by Perth iX using
MessageLabs SkyScan scanning service. For more information please call
Perth iX on +61 8 92166600 or email info at perthix.net.


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.426 / Virus Database: 239 - Release Date: 2/12/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.426 / Virus Database: 239 - Release Date: 2/12/2002
 



More information about the plug mailing list