in reply to One liner is returning unexpected "1" on the output and I do not understand the mechanism at play.
> Searches a string for a pattern, and if found, replaces that pattern with the replacement text and returns the number of substitutions made.
Your s/// replaced once, so it returned 1. Run the substitution before printing the result.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: One liner is returning unexpected "1" on the output and I do not understand the mechanism at play.
by perlynewby (Scribe) on Oct 16, 2020 at 19:25 UTC | |
by haukex (Archbishop) on Oct 16, 2020 at 20:40 UTC | |
|
Re^2: One liner is returning unexpected "1" on the output and I do not understand the mechanism at play.
by ikegami (Patriarch) on Oct 17, 2020 at 18:22 UTC | |
by Anonymous Monk on Oct 17, 2020 at 21:39 UTC | |
by ikegami (Patriarch) on Oct 17, 2020 at 22:00 UTC |