my $foo = some_func(); if ('ARRAY' eq ref $foo) { push @data => @$foo; } else { push @data => $foo; }