in reply to Re: 5.10 smart match behaviour
in thread 5.10 smart match behaviour
Did you just say "list in scalar context"? There's no such thing! His sub is *not* returning a list.
Maybe you meant "the comma operator in scalar context", but that would presuppose that functions built by constant use the comma operator.
In fact, it appears that the comma operator is *not* used. Quote the docs (emphasis in original),
Note that constants with more than one value do not return their last value in scalar context as one might expect. They currently return the number of values, but this may change in the future. Do not use constants with multiple values in scalar context.
That means that X (as built by constant) returns 3 in scalar context for the current version of constant, and that you shouldn't count on that always being the case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: 5.10 smart match behaviour
by Fletch (Bishop) on Jun 10, 2008 at 14:01 UTC | |
|
Re^3: 5.10 smart match behaviour
by zgrim (Friar) on Jun 10, 2008 at 14:25 UTC |