You need ref, like so:
sub thinger { my @array; if (ref($_[0]) eq 'ARRAY') { @array = @$_[0]; } else { @array = @_; } ... }
In reply to Re: Detecting Subroutine Input Type
by Chady
in thread Detecting Subroutine Input Type
by doran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |