Re: What symbols should Perl reserve for its use?
[email protected] ("Ruud H.G. van Tol" via perl5-porters)
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <[email protected]> |
On 2025-12-13 21:54, Karl Williamson wrote:
> I want to draw your attention to
https://github.com/Perl/perl5/pull/24003 which creates a pattern for
such symbols
>
> We need to have a discussion on how that pattern should be changed.
Here just some first observations.
delimitted -> delimited
The new regex needs several changes, to achieve the stated goals.
For example, if uppercase is [A-Z], then digits should be [0-9].
Or add 'aa' to the /x-modifier. Also 'ns', to avoid capturing and
multi-line treatment.
Consider having a single ("lexicographically" ordered?) list of (fully
expanded) test cases, each with a flag, maybe like:
0 PL_a
0 PL_a\n
0 PL_a\0
0 PL_a\1
1 PL_;
1 _PL_
1 __PL_
...
-- Ruud
P.S. Maybe even set some rules, like:
Reserve backslashes for symbolics, so spell '\.' as '[.]'.
Where feasible, spell '^' as '\A', as then its meaning can't change by
modifier.
Where feasible, spell '$' as '\z', to not ignore a newline; and as \Z
where a newline is OK to ignore.