CC: | sprout [...] cpan.org, pagaltzis [...] gmx.de, rurban [...] cpanel.net |
Subject: | On \0 in names before ~5.14 |
After https://github.com/rurban/sub-name/commit/3dff81c8#commitcomment-10462302 I figured it's worth opening a ticket specifically to track this issue (it was mentioned briefly in RT#69422).
This ticket exists to raise 2 questions
- Should \0 be allowed by Sub::Name at all, or should the major version be bumped and an explicit exception be thrown
- What should Sub::Name do on perls prior to http://perl5.git.perl.org/perl.git/commit/435e8dd0d, where \0 in names is not supported by the interpreter itself
The considerations in answering this are the following:
- Use cases of anonymouns subroutine naming
* The mro *next::method codepaths rely on methods being implmented via properly named coderefs
* caller() (and by extension the ecosystem of stack trace generators/analyzers)
- Technical validity of \0 in names
* Do not work properly at all prior to perl 5.13.7
* Are explicitly supported via tests since http://perl5.git.perl.org/perl.git/blobdiff/9343f4c..9922583:/ext/B/t/b.t or maybe earlier
- Logical validity of \0 in names
* In perl-land \0 is a character like any other. Allowing it seems sane
* In almost all circumstances \0 is not rendered on output, thus making it of questionable (malicious?) utility in caller() and friends
I myself am of the opinion: Allow \0 in line with perl5 (that decision has already been made, rehashing it makes no sense), die before 5.13.7.
Thoughts?