electic!mp has asked for the wisdom of the Perl Monks concerning the following question:
i am embarrassed to be stumped both by the problem and by my inability to google around it
anyhow, trying to go from, for example "2.3" to "2.03". so, i try:
s{(\d\.)(\d)}{$10$2}and obviously, the "$1" and the "0" get mushed together. i know i can do
...and many otherss{(\d)\.(\d)}{$1.0$2} s{(\d.)(\d)}{$1."0".$2}e
but my real question is, how does one separate variables from real stuff in the replacement?
e!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: separating replacements
by kcott (Archbishop) on Jan 01, 2017 at 01:18 UTC | |
|
Re: separating replacements
by BrowserUk (Patriarch) on Jan 01, 2017 at 01:19 UTC | |
|
Re: separating replacements
by tybalt89 (Monsignor) on Jan 01, 2017 at 01:11 UTC | |
|
Re: separating replacements
by Lotus1 (Vicar) on Jan 01, 2017 at 23:40 UTC |