XP is just a number | |
PerlMonks |
Re: What should be returned in scalar context? (frog)by tye (Sage) |
on Dec 03, 2003 at 07:14 UTC ( [id://311849]=note: 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 Section
Meditations
|
|