|
|
| No such thing as a small change | |
| PerlMonks |
Re^2: Subroutine Parametersby chargrill (Parson) |
| on May 31, 2007 at 04:13 UTC ( #618388=note: print w/ replies, xml ) | Need Help?? |
|
In your code snippet, the "user" sub was written to expect an array reference and a hash reference as its args, but when you called the sub, you forgot to put backslashes in front of the args, and so you passed the full list of array values and hash keys and values instead. I suspect that was a copy/paste error when you posted the code. If it had been that way in the script that you actually ran, I think you would have gotten an error message (something about "can't treat a string (or number?) as an array reference") Not quite - prototypes silently coerce arguments to match prototypes in this case. In perlsub:
Grandfather was actually explaining about the return assignment:
--chargrill
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||