in reply to Re^4: check for wantarray?
in thread check for wantarray?

One cannot, for the simple reason that no array is ever returned by a sub. A sub returns a list and a single element list is indistinguishable from a scalar (and as you know a scalar can also contain a reference or an object, which is just a blessed reference). IMHO the question is therefore irrelevant.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James