in reply to Re^2: Distinguishing between an array of objects and an array of strings
in thread Distinguishing between an array of objects and an array of strings
Indeed, and unfortunally, if $var isn't a reference, ref($var) returns a false, but defined value, so testing for defined ref($var) is even worse than testing for ref($var). However, it isn't possible to bless something into a package with no name, if the second argument of bless equals the empty string, the thing is blessed into main. So, if ref returns anything but the empty string, its argument is a reference.