finding the last element in a referenced array

From: .rhavin (
Date: 10/05/04

Date: 5 Oct 2004 08:37:38 -0700

i searched the usenet for a while and i wasn't able to find something
useful. perhaps i looked in the wrong places or i am to stupid -
whatever... here's my problem:

i want to access the last elemt of an array... sounds like $#array, i
know, but in my case, the array is stored as a reference in a
construction like this:


i can access the last element by


cos i know it is the second, but i need a way to access the last
element without knowing whether it is the first, or the zeroth or

i tried


but it doesn't work this way...

anybody willing to help, explain the mystics or simple