in reply to Counting elements in array

You may have noticed that Perl uses sigils in front of variable names? They aren't part of the variable name, they show that type of thing the variable (or expression) returns. So a $ sigil returns a scaler 'value' - regardless of how that 'value' is being used. An @ returns a list. A % returns a hash (which is a list of key value pairs). Sigils are more like conversion operators than part of variable identifiers.

If the code changes take longer than the time saved, it's fast enough already.