Look at UNIVERSAL::isa, it's better than ref() in any cases, course it let you to determine the type of blessed reference.
For example, see code below:
if (UNIVERSAL::isa($ref, 'ARRAY')) { print 'It's an array reference'; }
Comment on Re: Distinguishing between an array of objects and an array of strings