in reply to Detecting Subroutine Input Type
I think that you should check the length of @_ and if it is 1, then make sure that that one item is not only a reference but a refernce to an array.
sub regardless { return unless @_; my @array = @_; if (@array == 1) { my $ref = ref($array[0]); if ($ref) { return unless ($ref eq 'ARRAY'); @array = @{$array[0]}; } } return wantarray ? @array : \@array; }
|
|---|