size is a terrible name, because it doesn't imply any unit. It could stand for string length in characters, string length in bytes, used memory, number of allocated elements in a container, number of actual elements in a container or any other size you can think of.
It makes sense to you now because it's not too bad in the mental context you are in, but from the outside it's not good.
Anyway, if you don't fiddle with prototypes at all, the argument list of a subroutine is automatically in list context, so you can just write
sub elems { scalar @_ }
and don't need a new keyword at all.