in reply to Re^3: Strange Occurrence in Substitution Statement
in thread Strange Occurrence in Substitution Statement
This idiom is meant to be used as s//something/ in complicated parsing, kind of inherited from sed/awk IIRC.
You should also be aware that a genuinely empty pattern IS always matching. In your case the replacement is just invisible because empty.
So I'd rather prefer to make this explicit and self documenting
Nowadays I doubt there are more than a fraction of a percent of programmers knowing/using this feature.
I'd really like to see a Perl version/feature to switch it off by default.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Strange Occurrence in Substitution Statement
by choroba (Cardinal) on May 07, 2025 at 06:38 UTC | |
by LanX (Saint) on May 07, 2025 at 19:42 UTC | |
|
Re^5: Strange Occurrence in Substitution Statement
by roho (Bishop) on May 07, 2025 at 04:36 UTC |