in reply to Re^2: 5.10 smart match behaviour
in thread 5.10 smart match behaviour

As has been pointed out, it's a binary operator (...)

I know it is a binary operator, and I personally do know how to handle that...  I'm just saying that it might be more intuitive if it would default to a (more DWIM) list context interpretation instead... (I bet this very problem is going to be a recurring issue here at PM).

I so far haven't seen a convincing argument why it couldn't - in theory - behave that way ("not breaking orthogonality" is not sufficiently convincing, IMHO). A lot in Perl is concerned with making code do what people expect. And after all, there are other builtins, and at least one operator that can deal with lists just fine (think of (1, 2, 3) x 5).

Sure, changing things will create conflicts with respect to the currently documented behaviour, but I wonder if it's primarily those scalar context variants that people will be thinking of using the smart match operator for, or if it's more the particularly neat implicit iteration behaviour that people will predominantly be wanting to use this operator for. In the latter case, it would be more natural if it could deal with lists without any special ado...  Just my five cents.

(Ultimately, what's intuitive and what isn't is mostly an empirical or statistical question, so maybe we should have a PM poll on that?)