in reply to What does $# stand for?
Many people tend to forget in the heat of the moment that $# gives you the last index of the list - not the number of elements in it.
Because of this:
$#list won't give you the same result as scalar @list.
This, I will admit, caught me a fair few times when I was starting out.
Just a simple thought, probably beneath most of you guys out there, but one worth remembering ;)
|
|---|