in reply to A list assignment gotcha
in thread Not understanding 2 sentences in perldoc
If you really needed this, it could be done with a little syntactic sugar
something like
L($x,$y,$z) += L(1,2,3);
the trick would be to let L() ( for "list" ) return an object with overload ed operators (in scalar context) performing the side-effect
Tho I'm not sure if the RHS needs to be packed into an object too, but I assume += is imposing scalar context.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A list assignment gotcha
by choroba (Cardinal) on Jul 30, 2020 at 13:02 UTC | |
by LanX (Saint) on Jul 30, 2020 at 14:48 UTC | |
by jcb (Parson) on Jul 31, 2020 at 01:32 UTC | |
by LanX (Saint) on Jul 31, 2020 at 02:20 UTC | |
by jcb (Parson) on Aug 01, 2020 at 02:10 UTC | |
|