Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
PerlMonks  

The Monastery Gates

( [id://131]=superdoc: print w/replies, xml ) Need Help??

New here?I want to ask a question of the Perl Monks. Where do I start?

Notices:

hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.

If you're new here, please read PerlMonks FAQ
and Create a new user!

Quests
poll ideas quest 2025
Starts at: Jan 01, 2025 at 00:00
Ends at: Dec 31, 2025 at 23:59
Current Status: Active
3 replies by pollsters
    First, read How do I create a Poll?. Then suggest your poll here. Complete ideas are more likely to be used.

    Note that links may be used in choices but not in the title.

Perl News
Dotcom Survivor Syndrome � How Perl�s Early Success Created the Seeds of Its Downfall
on Dec 03, 2025 at 04:25
0 replies by mldvx4

    Dave Cross has posted Dotcom Survivor Syndrome � How Perl�s Early Success Created the Seeds of Its Downfall about current misconceptions about Perl and how those misconceptions came to be.

    Can We Move On?

    Dotcom Survivor Syndrome is real. So is Version Number Paralysis. Together, they�ve unfairly buried a language that remains fast, expressive, and battle-tested.

    We can�t change the past. But we can:

    • Acknowledge the emotional and historical baggage
    • Celebrate the role Perl played in inventing the modern web
    • Educate developers about what Perl really is today
    • Push back against the assumption that old == obsolete

    Certain vendors have certainly played the appeal to novelty fallacy to its outer limits to sell their own gimmicks while simultaneously maligning Perl. That'll take a lot to overcome, but is doable.

Advent Calendar 2025
on Dec 01, 2025 at 04:26
0 replies by hippo

    Yes, it's December again which means that it is time for the Perl Advent Calendar.

    It is not too late to contribute to the calendar as they do not yet have 24 articles ready to go and are soliciting entries via the github repo. If there is a favourite module you think the world should know about or some insight you have gained from a particular project now would be a good time to write it up and submit it.

    Happy Advent!


    🦛

Supplications
Faster (but uglier) PWC 350-2 solutions
2 direct replies — Read more / Contribute
by Anonymous Monk
on Dec 09, 2025 at 07:09

    TASK2: https://theweeklychallenge.org/blog/perl-weekly-challenge-350/#TASK2

    Looks like the consensus on how to approach this would be to "split, sort, join" to generate keys for finding pair pals. Further, as smarter guys explained, using modulo arithmetic voodoo, a lot of unfriendly numbers (which can't have any pals anyway) should simply be skipped; and, of those that remain, it's pointless to ask some of the witnesses about, i.e skip these witnesses, too. So, my subroutine to solve the problem is:

    sub pwc { my ( $from, $to, $target ) = @_; use integer; my @witnesses = ([ 4, 7 ], [ 2 .. 9 ]); my ( %pairs, $j ); for ( my $i = ( $from + 2 ) / 3 * 3; $i <= $to; $i += 3 ) { my $i_key = join '', sort split '', $i; my $k = $i % 9 ? 0 : 1; for ( @{ $witnesses[ $k ]}) { last if length( $j = $i * $_ ) != length( $i ); $pairs{ $i }{ $j } = $_ unless $i_key ne join '', sort split '', $j } for ( @{ $witnesses[ $k ]}) { last if length( $j = $i / $_ ) != length( $i ); $pairs{ $i }{ $j } = -$_ unless $i % $_ || exists $pairs{ $j } && exists $pairs{ $j }{ $i } || $i_key ne join '', sort split '', $j } } return scalar grep { %$_ >= $target } values %pairs }

    However, even though some solutions mention "speed", I haven't seen optimizations which follow. First, if using CPAN modules is OK (and why not), almost exactly twice as fast is to sort in-place instead:

Log In?
Domain Nodelet?
Chatterbox?

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2025-12-13 06:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?

    Results (92 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.