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 = @_; } ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Detecting Subroutine Input Type
by Anonymous Monk on May 03, 2004 at 08:21 UTC | |
|
Re: Re: Detecting Subroutine Input Type
by doran (Deacon) on May 03, 2004 at 16:48 UTC |