http://qs321.pair.com?node_id=455747


in reply to Is there an isArray() in Perl?

Alternatively, you can use universal.pm
use UNIVERSAL 'isa'; foreach $item (@array) { if (isa($item, 'ARRAY')) { print "We've got an array!!\n"; } }

Replies are listed 'Best First'.
Re: Answer: Is there an isArray() in Perl?
by salva (Canon) on May 11, 2005 at 10:42 UTC
    UNIVERSAL is available even without use'ing it, so the previous code snippet can be rewritten as:
    foreach $item (@array) { if (UNIVERSAL::isa($item, 'ARRAY')) { print "We've got an array!!\n"; } }
      Correct; the only point of use'ing UNIVERSAL is to import the function(s)...which he does.