You can use $#fred to get the index value of the last element of @fred +. [download]
In reply to Re: What does $#variable mean? by pelagic in thread What does $#variable mean? by Scarborough