Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The behaviour makes sense to me but I don't think the docs are as clear as they might be. They do say:
The key phrase in the above being "one operation." When used as an lvalue it does it in two operations, the assignment and then the substr and you get the result of the substr(). Update: I was becoming more and more convinced that my guess was the correct one. Then I discovered this:
given that the substring is different in the two cases, it isn't just doing the substr() after the replacement. I'd say that is a bug and I think I have to agree with tye. It seems that the "right" behavior would be to return the string assigned as in any assignment. I wonder how many obfus changing that will ruin... -sauoq "My two cents aren't worth a dime."; In reply to Re: [substr] anomaly or mine?
by sauoq
|
|