On Sunday 08 May 2005 00:13, 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?
Of course, TMTOWTDI (http://catb.org/~esr/jargon/html/T/TMTOWTDI.html) $ARRAY[$#ARRAY--] See: http://perldoc.perl.org/functions/pop.html But, if you know how many items you have in your array, you can call it: $array[last_item] where last item is the number/item you want minus one. If this is unclear, just say and I will explain it a bit more. -- Walking the road to enlightenment... I found a penguin and a camel on the way..... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>