Varying return types has always caused problem for me down the road. Best thing to do might be to always return ref regardless of the number of parameters you receive.
I think a hashref here is a better return value than an array ref. Perl already has hashes built in. If you return an array ref, you are forcing the user of your API to re-implement associative arrays.
In reply to Re: function call / return philosophies
by ehdonhon
in thread function call / return philosophies
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |