http://www.perlmonks.org?node_id=349927


in reply to Detecting Subroutine Input Type

You need ref, like so:

sub thinger { my @array; if (ref($_[0]) eq 'ARRAY') { @array = @$_[0]; } else { @array = @_; } ... }

He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/