in reply to Re: Class::Struct accessor function after Perl V5.16
in thread Class::Struct accessor function after Perl V5.16
if (@_&& ref @_ ne ‘ARRAY’) {
No, not quite, ref @_ won't do what you want. If you wanted to check that a function was called with exactly one argument that is an arrayref: if ( @_==1 && ref $_[0] eq 'ARRAY' ) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Class::Struct accessor function after Perl V5.16
by Anonymous Monk on Jan 03, 2019 at 09:03 UTC |