Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The subdivision of scalar context into string and numeric. And the numeric context subdivided into integer and real. That might be easy in these cases:
But how could you handle the simple case of assigning the return value to a variable? I suppose the current type of the SV could be used if it already had data in it, but what about variables that were just declared? List context should be subdivided into list, array and hash context. I know the differences between list and array context are very subtle, but I'm not sure that there is any use for distinguishing the two here. ---- : () { :|:& };: Note: All code is untested, unless otherwise stated In reply to Re: Re: What should be returned in scalar context?
by hardburn
|
|