3 ms·
Hmm. perl -le '$A = "ABCDEF"; substr($A, 3, 0) = 123; print $A' ABC123DEF
by exikyut 8y ago
Hmm.
perl -le '$A = "ABCDEF"; substr($A, 3, 0) = 123; print $A'
ABC123DEF
- aduitsis 8y agohttps://perldoc.perl.org/perlsub.html#Lvalue-subroutines https://perldoc.perl.org/perlsub.html#Lvalue-subroutines
- imglorp 8y agoLook again at that comment. He wasn't remarking about a substr, it was the curious syntax where the LHS of an assignment was actually an argument to the RHS function.
- deleted 8y ago[deleted]