Updated: to correct brainfart!
Actually, I didn't see it that way and was about to suggest that nobody would think twice about using a slice as an rvalue in a list context...but decided to try it first...and waddayaknow...
0.04 0.02 >@a = qw(a b c d e)
0.04 0.02 >print "@a", $/
a b c d e
0.04 0.02 >@a[1..3] = qw(x y z)
0.04 0.02 >print "@a", $/
a x y z e
0.04 0.02 >print @a[1..3] = qw(p q r)
p q r
0.04 0.02 >print "@a", $/
a p q r e
So, once I got the syntax right, a slice in a list context does work pretty much as you would expect. It does the assignment and then, returns the value assigned.
What's this about a "crooked mitre"? I'm good at woodwork! |