Y
Hacker News
new
|
ask
|
show
|
jobs
by
exikyut
2837 days ago
Hmm.
perl -le '$A = "ABCDEF"; substr($A, 3, 0) = 123; print $A' ABC123DEF
2 comments
imglorp
2837 days ago
Look 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.
link
aduitsis
2837 days ago
https://perldoc.perl.org/perlsub.html#Lvalue-subroutines
link