sub field{ my ($arr1,$num,$arr2,$num2) = @_; warn "Error in 'arr1'"; # or warn "Error: first arg to field must be an array reference" unless r +ef($arr1) eq 'ARRAY'; # etc }
Unless I've misunderstood your question entirely... without getting into any 'B::' modules which may/may not be able to get you there I don't see how or why you would need this.
Your subroutine takes any args it gets and assigns them to variables of it's choosing.. it's irrelevant what the caller knew them as so you just need to hardcode the name of the array in your subroutine's error message.
cheers,
J
In reply to Re: printing references
by edoc
in thread printing references
by mhearse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |