develooper Front page | perl.perl5.porters | Postings from January 2023

Re: Making s:foo:bar: warn "reserved" - contentious idea?

Thread Previous
Branislav ZahradnĂ­k
January 14, 2023 19:29
Re: Making s:foo:bar: warn "reserved" - contentious idea?
Message ID:
On Sat, 14 Jan 2023 at 15:40, Paul "LeoNerd" Evans <>

> I have a longterm thought that one day it'd be nice if we could have
> more, and more descriptive, string quoting and regexp flags - especially
> on substitutions. For example, I'd love to be able to replace only the
> third "foo" with "bar" by doing something, maybe using syntax like this:
>   $str =~ s:nth(2)/foo/bar/;
what about making these attributes attributes of operator instead? eg:
$str =~ :nth(2) s:foo:bar:;

Anyway, +1 for warning and future deprecation, it will get rid of some
confusions making lexers / parsers more complicated, eg:
package m { sub x { die } };

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About