use Scalar::Util 'reftype'; if (reftype ($foo) eq 'ARAY') { # spot the typo do_something (); }