Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The only default I can think of that makes much sense to me is:
So, if you haven't taken the time to decide what should be returned by your list-returning function when used in a scalar context, it makes some sense to prevent people from using your function that way (yet), perhaps even telling the user that you haven't decided what that is supposed to mean yet. After you've used the function for a while, a sane choice may well become rather obvious and you can put the new scalar-context behavior in place, quite confident that you aren't breaking any existing code.
- tye In reply to Re: What should be returned in scalar context? (frog)
by tye
|
|