in reply to Distinguishing between an array of objects and an array of strings

Strings are not references in Perl. So ref could actually tell you whether a scalar is a plain scalar, a refrerence, or an object.

However, you should be very aware that people might be trying to pass objects, that they want to be treated as strings. See overload, operator '""', on how you can make an object from any class, return a useful result when treated as a string.

  • Comment on Re: Distinguishing between an array of objects and an array of strings