|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: What should be returned in scalar context?by duff (Vicar) |
| on Dec 02, 2003 at 15:56 UTC ( #311658=note: print w/ replies, xml ) | Need Help?? |
|
I don't think there should be a "standard". That's why this particular feature is in the hands of the programmer; so that they can make the decision about what's best. Sometimes you want to return the first element of an array in scalar context, sometimes you want to return something else. Why do you think that there should be some standard? Also, you have completely ignored void context. wantarray returns 3 things you know. Do you think that there should be some "standard" for what to do in void context too?
In Section
Meditations
|
|
||||||||||||||||||||||||