in reply to Re^8: Operator overloading with returning lists?
in thread Operator overloading with returning lists?
scalar affects the behaviour of the operator for which it sets the context. If perl was written in Perl, scalar would look something like
sub scalar { local $context = 'scalar'; return $child_op->(); }
scalar does not convert the result of the operator. If perl was written in Perl, scalar would NOT look like
sub scalar { return _coerce_to_scalar( $child_op->() ); }
In "scalar((1,2)x5)", scalar affects the behaviour of x.
In "scalar(@_)", scalar affects the behaviour of the array access.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Operator overloading with returning lists?
by LanX (Saint) on Dec 01, 2008 at 17:04 UTC | |
by ikegami (Patriarch) on Dec 01, 2008 at 17:20 UTC |