60 PerlMonks - Newest Nodes New nodes appearing on PerlMonks http://perlmonks.org/~perl2/bare/index.pl?node_id=30175 http://blogs.law.harvard.edu/tech/rss PerlMonks Newest Nodes XML Generator rss,clean Wed Apr 15 09:14:25 2026 PerlMonks 961 http://perlmonks.org/ Wed Apr 15 09:14:25 2026 30 20260415091425 Anonymous Monk 2026-04-18 13:14:25 Failed 2 tests on CygPerl for Test2::Harness; would a newer perl pass? Intrepid http://perlmonks.org/~perl2/bare/index.pl?node_id=11167551 I tried installing <a href="https://metacpan.org/pod/Test2%3A%3AHarness">Test2::Harness</a> and a couple tests failed. I am not totally understanding the output and if someone knowledgeable could interpret this for me I'd be grateful. ... perlquestion Wed, 15 Apr 2026 18:44:09 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167551 11167551 19724 2026-04-15 14:44:09 Intrepid metacpan fastapi can't find the Config module Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167545 I ran into this problem looking up module versions with fastapi on metacpan: % perl -MHTTP::Tiny -MJSON::PP -le 'print decode_json(HTTP::Tiny->new->get("https://fastapi.metacpan.org/v1/module... perlquestion Wed, 15 Apr 2026 14:39:17 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167545 11167545 961 2026-04-15 10:39:17 Anonymous Monk ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167543 % perl -MExtUtils::Installed -le 'print for ExtUtils::Installed->new->files("Catalyst")' Catalyst is not installed at -e line 1. % perl -MModule::Metadata -le 'print Module::Metadata->ne... perlquestion Wed, 15 Apr 2026 14:27:33 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167543 11167543 961 2026-04-15 10:27:33 Anonymous Monk Re^21: Reusing a complex regexp in multiple spots, escaping the regexp dave_the_m http://perlmonks.org/~perl2/bare/index.pl?node_id=11167581 On unthreaded builds, after the pattern has been assembled and compiled once, the op tree is modified so that on subsequent executions, all the assembly ops are skipped. On threaded builds, all the as... note Sat, 18 Apr 2026 12:30:23 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167581 11167581 341121 2026-04-18 08:30:23 dave_the_m Re^20: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167580 Thanks for the better example! Does this double execution also effect officially embedded (?{CODE}) ? Shouldn't this be just documented with /o or (in a better world) even better em... note Fri, 17 Apr 2026 17:07:20 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167580 11167580 708738 2026-04-17 13:07:20 LanX Re^2: ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist (it has 10 packlists!) Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167579 Good catch! You're right about the -a option but missed the -h :-). I do use an alias (alias ll='ls -lha') and replaced it with ls -l to prevent confusion but just created more! Anyway the dotfile abs... note Fri, 17 Apr 2026 16:04:09 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167579 11167579 961 2026-04-17 12:04:09 Anonymous Monk Re^19: Reusing a complex regexp in multiple spots, escaping the regexp dave_the_m http://perlmonks.org/~perl2/bare/index.pl?node_id=11167578 The "code injection" was just a quick and dirty demonstration of a side-effect. Its shows that on a threaded build, the expression which defines the pattern is assembled each time, but then thrown awa... note Fri, 17 Apr 2026 15:29:15 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167578 11167578 341121 2026-04-17 11:29:15 dave_the_m Re^18: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167577 Thanks for the clarification. ° Honestly, when injecting code evaluation into a variable interpolation, I'm not surprised to get inconsistent side effects. It would be of bigger concern if... note Fri, 17 Apr 2026 15:13:23 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167577 11167577 708738 2026-04-17 11:13:23 LanX Re^17: Reusing a complex regexp in multiple spots, escaping the regexp dave_the_m http://perlmonks.org/~perl2/bare/index.pl?node_id=11167576 I tried your code on "unthreaded" perl and it prints twice. It seems like this weird "interpolation" ° resolves to "x1" =~ /x1/ which doesn't make much sense as a bug demo. ... note Fri, 17 Apr 2026 14:52:56 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167576 11167576 341121 2026-04-17 10:52:56 dave_the_m Re^15: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167575 The poor and distributedą documentation is the problem And the way perldocs are often handled as witty prose resulting from group dynamics instead of being based on evidence (i.e. test cases).... note Fri, 17 Apr 2026 14:11:46 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167575 11167575 708738 2026-04-17 10:11:46 LanX Re^14: Reusing a complex regexp in multiple spots, escaping the regexp tobyink http://perlmonks.org/~perl2/bare/index.pl?node_id=11167574 It's like complaining about state being buggy since it acts differently to my ... Indeed, that's exactly what it is. Why it could be considered buggy in th... note Fri, 17 Apr 2026 14:03:10 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167574 11167574 757127 2026-04-17 10:03:10 tobyink Re^16: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167573 &gt; on unthreaded, once. I tried your code on "unthreaded" perl and it prints twice. It seems like this weird "interpolation" ° resolves to "x1" =~ /x1/ which doesn't make ... note Fri, 17 Apr 2026 13:59:00 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167573 11167573 708738 2026-04-17 09:59:00 LanX Re^17: Reusing a complex regexp in multiple spots, escaping the regexp choroba http://perlmonks.org/~perl2/bare/index.pl?node_id=11167572 I think "threaded perl" means an interpreter compiled with -Dusethreads. It changes the output regardless of whether you use threads in the code or not. ... note Fri, 17 Apr 2026 13:30:23 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167572 11167572 832495 2026-04-17 09:30:23 choroba Re^16: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167571 Thanks! Please, how can I reproduce this? There are multiple threaded Perl models. I never wrote threaded Perlą, so please explain What's the output without /o then? ... note Fri, 17 Apr 2026 13:27:27 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167571 11167571 708738 2026-04-17 09:27:27 LanX Re^15: Reusing a complex regexp in multiple spots, escaping the regexp dave_the_m http://perlmonks.org/~perl2/bare/index.pl?node_id=11167570 Well for example, consider the following code: for my $i (1..2) { print "match\n" if "x1" =~ /x${print "doing arg\n"; \1}/o; } On threaded perls it prints "doing arg" twice; o... note Fri, 17 Apr 2026 11:52:27 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167570 11167570 341121 2026-04-17 07:52:27 dave_the_m Re^13: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167569 I did some research and couldn't find a bug introduced by /o. Please demonstrate one, which is not just someone complaining that it acts differently, or misunderstood the o for optimize instead ... note Fri, 17 Apr 2026 11:36:59 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167569 11167569 708738 2026-04-17 07:36:59 LanX Re^14: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167568 &gt; The longest explanation of /o This covers exactly my understanding. You'll also find this in perlop for <a href="http://perldoc.perl.org/functions/m.html">m//</a> - &#91;https://perldoc.perl.org/perlop#:~:text... note Fri, 17 Apr 2026 11:32:08 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167568 11167568 708738 2026-04-17 07:32:08 LanX Re^13: Reusing a complex regexp in multiple spots, escaping the regexp sleet http://perlmonks.org/~perl2/bare/index.pl?node_id=11167567 The longest explanation of /o is in perlfaq6: <a href="http://perldoc.perl.org/perlfaq6.html#What-is-%2Fo-really-for%3F">What is /o really for?</a>.... note Fri, 17 Apr 2026 10:02:58 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167567 11167567 1137922 2026-04-17 06:02:58 sleet Re^12: Reusing a complex regexp in multiple spots, escaping the regexp tobyink http://perlmonks.org/~perl2/bare/index.pl?node_id=11167566 Dunno, a literal quote would be helpful. Substitution-specific modifiers described in "s/PATTERN/REPLACEMENT/msixpodualngcer" in perlop are: e -... note Fri, 17 Apr 2026 08:15:55 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167566 11167566 757127 2026-04-17 04:15:55 tobyink Re^11: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167563 You are showing a semantic where /o MUST NOT be applied. Obviously you shouldn't inhibit recompilation if you need recompilation. One of the links sleet listed upthread (or the docs&#129300;)... note Thu, 16 Apr 2026 17:01:15 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167563 11167563 708738 2026-04-16 13:01:15 LanX Re^10: Reusing a complex regexp in multiple spots, escaping the regexp tobyink http://perlmonks.org/~perl2/bare/index.pl?node_id=11167562 I think that's what /o was invented for If a regexp contains something interpolated, I don't know if /o can do much for it. Consider: my... note Thu, 16 Apr 2026 15:05:48 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167562 11167562 757127 2026-04-16 11:05:48 tobyink Re^9: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167561 &gt; Pretty sure they're not kept as nested objects. That was my first intuition, and looks like we were right, the final program is the same for the flattened string. $ perl ... note Thu, 16 Apr 2026 14:39:08 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167561 11167561 708738 2026-04-16 10:39:08 LanX Re^8: Reusing a complex regexp in multiple spots, escaping the regexp tobyink http://perlmonks.org/~perl2/bare/index.pl?node_id=11167560 Pretty sure they're not kept as nested objects. I believe when the larger regexp is being compiled, any nested regexps are simply stringified and interpolated into it. In the original pos... note Thu, 16 Apr 2026 13:00:25 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167560 11167560 757127 2026-04-16 09:00:25 tobyink Re^7: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167559 I'm still not convinced that nesting qr// snippets into larger qr// parts is such a show stopper. Are they stored as nested objects causing overhead? (Hmm probably... I read som... note Thu, 16 Apr 2026 12:27:24 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167559 11167559 708738 2026-04-16 08:27:24 LanX Re: ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist Haarg http://perlmonks.org/~perl2/bare/index.pl?node_id=11167558 <a href="https://metacpan.org/pod/ExtUtils%3A%3AInstalled">ExtUtils::Installed</a>'s <a href="https://metacpan.org/pod/ExtUtils%3A%3AInstalled#files%28%29">files</a> method expects you to pass it the "main" module of a dist. For <a href="https://metacpan.org/pod/Catalyst">Catalyst</a>, this is <a href="https://metacpan.org/pod/Catalyst%3A%3ARuntime">Catalyst::Runtime</a>. ... note Thu, 16 Apr 2026 12:02:05 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167558 11167558 306692 2026-04-16 08:02:05 Haarg Re: Failed 2 tests on CygPerl for Test2::Harness; would a newer perl pass? hippo http://perlmonks.org/~perl2/bare/index.pl?node_id=11167557 Please don't use tags for large swathes of output like this. Use tags in preference. Thanks. &#129435; ... note Thu, 16 Apr 2026 09:31:03 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167557 11167557 885521 2026-04-16 05:31:03 hippo Re: ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist hippo http://perlmonks.org/~perl2/bare/index.pl?node_id=11167556 ls -l /perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0/darwin-2level/auto/CGI -rw-r--r-- 1 user staff 1.3K Jan 2 00:34 .packlist drwxr-xr-x 3 user staff 96B J... note Thu, 16 Apr 2026 09:28:06 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167556 11167556 885521 2026-04-16 05:28:06 hippo Re: metacpan fastapi can't find the Config module hippo http://perlmonks.org/~perl2/bare/index.pl?node_id=11167555 fastapi returns a 404 code when you request info on a module which doesn't exist on CPAN. This is by design. You say you ran into a problem but I'm not seeing any problem in what you have... note Thu, 16 Apr 2026 09:11:08 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167555 11167555 885521 2026-04-16 05:11:08 hippo Re: Failed 2 tests on CygPerl for Test2::Harness; would a newer perl pass? tobyink http://perlmonks.org/~perl2/bare/index.pl?node_id=11167554 I'm currently running yath (though an older version) on Perl 5.38 and it's fine. CPAN Testers shows a mixture o... note Thu, 16 Apr 2026 08:33:57 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167554 11167554 757127 2026-04-16 04:33:57 tobyink Re^6: Reusing a complex regexp in multiple spots, escaping the regexp sleet http://perlmonks.org/~perl2/bare/index.pl?node_id=11167553 Note the (?(DEFINE)...) construct has it's own performance issue. From <a href="http://perldoc.perl.org/perlre.html#%28DEFINE%29">(DEFINE)</a>: patterns defined this way probably will not be as efficient, as the optimize... note Wed, 15 Apr 2026 22:32:15 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167553 11167553 1137922 2026-04-15 18:32:15 sleet Re^5: Reusing a complex regexp in multiple spots, escaping the regexp LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167552 Hmm interesting, and it seems there is no consensus what's happening. Dave_the_m says the qr object is always duplicated because matches depend on scope. Aristotle says, using an a... note Wed, 15 Apr 2026 20:27:17 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167552 11167552 708738 2026-04-15 16:27:17 LanX Re^4: Reusing a complex regexp in multiple spots, escaping the regexp sleet http://perlmonks.org/~perl2/bare/index.pl?node_id=11167550 It's also far less efficient (though perhaps not enough to matter). It surprises many people that qr is slower than expected: <a href="?node_id=1205956">Performance penalty of using qr//</a> ... note Wed, 15 Apr 2026 18:01:42 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167550 11167550 1137922 2026-04-15 14:01:42 sleet Re^3: ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist Corion http://perlmonks.org/~perl2/bare/index.pl?node_id=11167549 Meta: Consider adding such information to your top post in the first place instead of waiting for replies trying to find out what your actual problem or question is. Maybe also consider phrasing th... note Wed, 15 Apr 2026 17:32:37 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167549 11167549 5348 2026-04-15 13:32:37 Corion Re^2: ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167548 I think <a href="https://metacpan.org/pod/ExtUtils%3A%3AInstall">ExtUtils::Install</a> creates the .packlist during make install. It was installed by cpanm like all my other modules and a reinstall did not create a .packlist. Going through the Catal... note Wed, 15 Apr 2026 17:00:14 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167548 11167548 961 2026-04-15 13:00:14 Anonymous Monk Re^2: ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist roho http://perlmonks.org/~perl2/bare/index.pl?node_id=11167547 I agree with <a href="?node=Corion">Corion</a>'s advice. I prefer the package installer route that creates .packlist for you. ... note Wed, 15 Apr 2026 16:16:44 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167547 11167547 140424 2026-04-15 12:16:44 roho Re: metacpan fastapi can't find the Config module LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167546 What's the question? If it was is a bug you should file a bug report. But my guess is that you meant <a href="https://metacpan.org/pod/config">config</a> which is lower case. Edit Ugh ..... note Wed, 15 Apr 2026 14:50:14 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167546 11167546 708738 2026-04-15 10:50:14 LanX Re: ExtUtils::Installed fails to find Catalyst because it doesn't have a .packlist Corion http://perlmonks.org/~perl2/bare/index.pl?node_id=11167544 So consider (re)installing <a href="https://metacpan.org/pod/Catalyst">Catalyst</a> with a package installer that creates a .packlist file, or create it yourself?... note Wed, 15 Apr 2026 14:37:48 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167544 11167544 5348 2026-04-15 10:37:48 Corion jjsloan jjsloan http://perlmonks.org/~perl2/bare/index.pl?node_id=11167564 user Thu, 16 Apr 2026 23:58:57 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167564 11167564 11167564 2026-04-16 19:58:57 jjsloan