in reply to Re: 5.10 smart match behaviour
in thread 5.10 smart match behaviour
And it would magically determine whether to call an arbitrary function between list and scalar contexts how . . . ?
As has been pointed out, it's a binary operator (albeit a two-character-wide one) just like + so the operands are put in scalar context just like every other binary operator. If you want it to work as if called on an array(ref), explicitly provide it with one by wrapping with []. Otherwise you're creating an exception for this one op and breaking orthagonality.
Update: Someone mentioned that there's other two-character-wide binary ops, and you know actually most of them are two chars. /me needs more caffeine . . .
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: 5.10 smart match behaviour
by almut (Canon) on Jun 10, 2008 at 14:58 UTC |