in reply to Re^3: One liner is returning unexpected "1" on the output and I do not understand the mechanism at play.
in thread One liner is returning unexpected "1" on the output and I do not understand the mechanism at play.
Yes it is. They asked to "print line with no leading space" instead of "1".
This can be achieved by replacing
withprint s/^\s+//, ...; # This is printing 1
print s/^\s+//r, ...;
|
|---|
| Replies are listed 'Best First'. |
|---|