New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/c modified with substitute s/// #17071
Comments
From @jimavCreated by @jimavThis is a bug report for perl from jim.avera@gmail.com, ----------------------------------------------------------------- "s/PATTERN/REPLACEMENT/msixpodualngcer" but it does not seem to be implemented. "Use of /c modifier is meaningless in s///" Suggest fixing/clarifing the docs (or better, make it work i.e. leave Perl Info
|
From @tonycozOn Mon, 01 Jul 2019 12:38:24 -0700, jim.avera@gmail.com wrote:
Making /c behave like for s/// would be the reverse of the meaning of /c from m//. Currently m/.../c prevents pos() being reset when the regexp doesn't match, but that's the case with s/// anyway (with or without the /g). Changing s///c to modify pos() might break existing code that was written without warnings, so we'd need to go through a deprecation cycle to remove it (which adds a default on warning rather than the default off warning you get now.) A non-deprecation documentation patch is attached. Tony |
From @tonycoz0001-perl-134250-c-does-nothing-for-s.patchFrom 1769f1541f31f412403334826c77f9a13c8b9b9f Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Mon, 16 Sep 2019 14:55:01 +1000
Subject: (perl #134250) /c does nothing for s///
Another option would be to go through a deprecation cycle.
We can't just remove it, since there might be existing code that
has (the non-functional) /c.
---
pod/perlop.pod | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 58127e8bc8..071bbcf074 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -2276,6 +2276,9 @@ to occur that you might want. Here are two common cases:
# expand tabs to 8-column spacing
1 while s/\t+/' ' x (length($&)*8 - length($`)%8)/e;
+X</c>While C<s///> accepts the C</c> flag, it has no effect beyond
+producing a warning if warnings are enabled.
+
=back
=head2 Quote-Like Operators
--
2.11.0
|
The RT System itself - Status changed from 'new' to 'open' |
Another option would be to go through a deprecation cycle. We can't just remove it, since there might be existing code that has (the non-functional) /c. fixes Perl#17071
Another option would be to go through a deprecation cycle. We can't just remove it, since there might be existing code that has (the non-functional) /c. fixes #17071
Migrated from rt.perl.org#134250 (status was 'open')
Searchable as RT134250$
The text was updated successfully, but these errors were encountered: