Implement B::cstring for PerlOnJava regex stringification
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 48/100
Research direction
Start with src/main/perl/lib/B.pm and compare B::cstring behavior with system Perl for the string and regexp cases listed in the acceptance criteria. Then add focused regression coverage, validate it with standard Perl and both PerlOnJava backends, and run all eight Regexp-Lexer 0.05 test files; done means the behavior is compatible and those tests pass.
Written by the indexing model from the issue text.
Description
Summary
Implement Perl-compatible B::cstring support in PerlOnJava's B module. Regexp::Lexer 0.05 uses this core B helper to turn a compiled regexp into a quoted string before tokenizing it. PerlOnJava's B.pm is a partial stub and does not define cstring, so the module loads but its tokenizer fails at runtime.
This is related to the broader B compatibility exploration in #1291, but is a standalone pure-Perl API gap: the reproducer does not require B::Utils or XS.
Reproducer
use B;
my $quoted = B::cstring(qr/foo/i);
print "$quoted\n";
With system Perl 5.34.1, this prints:
"(?^i:foo)"
On PerlOnJava at 168259c9e, both the JVM and interpreter backends exit 255 with:
Undefined subroutine &B::cstring called at -e line 1.
CPAN evidence
- Distribution:
Regexp-Lexer0.05 (MOZNION/Regexp-Lexer-0.05) - Archived random tester run:
20261118-104825-43075 - Failing files:
t/01_basic.t,t/03_escaped_N.t,t/04_double_quote.t,t/05_empty.t, and both tests undert/10_with_not_meta_newline/ - All six runtime failures terminate in
Regexp::Lexer::tokenizeat itsB::cstring($re)call.t/00_compile.tandt/02_exceptional.tpass. - The full upstream suite passes on system Perl 5.34.1: 8 files, 10 tests, recursive
provewith the distribution'slibdirectory on@INC.
Root cause
src/main/perl/lib/B.pm implements a minimal subset of Perl's B module, but has no cstring function. The repository's XString::cstring helper quotes a supplied string; it does not implement the B::cstring interface or itself obtain the Perl string form of a regexp. The upstream module relies on B::cstring's quoted regexp string, including modifier representation and escaping, so a plain B::perlstring call is not automatically a compatible substitute.
Acceptance criteria
- Provide
B::cstringbehavior compatible with system Perl for strings and compiled regexps, including escaped metacharacters, quotes, backslashes, modifiers, and Unicode/byte strings as applicable. - Add focused project regression coverage validated first with standard Perl, then on both PerlOnJava backends.
- Re-run all eight
Regexp-Lexer0.05 test files and confirm the CPAN failure is resolved.
- Dominant language
- Perl
- Stars
- 67
- Forks
- 8
- Avg merge
- 5h 12m
- Merged PRs (30d)
- 131
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
fglock/PerlOnJava#2153 ·
Maintainers usually reply within 1 day
-
area:cpan-port area:parser bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
fglock/PerlOnJava#2137 ·
Maintainers usually reply within 1 day
-
area:backend area:cpan-port area:runtime bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
fglock/PerlOnJava#2071 ·
Maintainers usually reply within 1 day
-
area:runtime documentation enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fglock/PerlOnJava#1579 ·
Maintainers usually reply within 1 day
-
area:cpan-port bug
Difficulty 3/5 1-2 days Newbie friendliness 62/100
fglock/PerlOnJava#2157 ·
Maintainers usually reply within 1 day
All issues in fglock/PerlOnJava
Similar issues
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksOpenteam-cli
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 1/5 Under an hour Newbie friendliness 93/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
inverse-inc/packetfence#9728 ·
Maintainers usually reply within 1 day
-
fix(char-create): show the real reason a character is refusedPossibly taken @baphomello claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day