in reply to Re^3: Reversed .= operator
in thread Reversed .= operator
Is $string =~ s/^/$prefix/; about the same speed as the substr expression?
To me, it would more signal the intent than substr does. Then again, so does the pesky dot-between-strings notation, which 1nickt doesn't want. :-) But, as with the substr, the =~ s/^// version doesn't require duplicating $string in your statement, which is one of the benefits of the suffixing .= operator.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Reversed .= operator
by choroba (Cardinal) on Apr 29, 2016 at 22:44 UTC | |
by BrowserUk (Patriarch) on Apr 30, 2016 at 03:24 UTC | |
by marioroy (Prior) on Apr 30, 2016 at 19:38 UTC | |
by choroba (Cardinal) on Apr 30, 2016 at 19:45 UTC | |
by marioroy (Prior) on Apr 30, 2016 at 20:00 UTC |