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:
if( $foo == bar($baz) ) { . . . } if( $foo eq bar($baz) ) { . . . }
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.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
In reply to Re: Re: What should be returned in scalar context?
by hardburn
in thread What should be returned in scalar context?
by tilly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |