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 2026
Starts at: Jan 01, 2026 at 00:00
Ends at: Dec 31, 2026 at 23:59
Current Status: Active
0 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
London Perl and Raku Workshop 2026 goes from Maybe to Likely
on Apr 27, 2026 at 09:01
0 replies by choroba
    The announcement

    Our love of Perl and Raku, means another London Perl and Raku Workshop is presently in the works for November 2026, with an exact date and venue to be confirmed in due course.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Linuxlinks on Perl Static Site Generators
on Feb 20, 2026 at 05:14
0 replies by mldvx4
Supplications
How do you determine what version of Perl your program requires?
3 direct replies — Read more / Contribute
by Anonymous Monk
on May 07, 2026 at 18:55
    perlver seems to do a good job of figuring out the syntax (except that --blame often fails to find the reason), but what about modules? Perl::MinimumVersion says "Future plans are to also add support for tracing module dependencies" but that hasn't happened yet. One might think corelist would help with core modules but it can be misleading. Let's say we use List::Util:
    % corelist List::Util
    List::Util was first released with perl v5.7.3
    
    But 5.7.3 is not the version needed if uniq or uniqnum are used:

    https://metacpan.org/dist/Scalar-List-Utils/changes:

    1.44 -- 2016/03/17 23:08:46
            CHANGES
             * Added List::Util::uniq() and uniqnum()
    
    % corelist -a List::Util | grep 1.44
    NOPE
    
    % corelist -r | grep 2016
    v5.22.2     2016-04-29
    ...
    5.22.2 is required to support uniq (or maybe an updated List::Util if that's possible). How do you determine what version of Perl your program requires? A robot told me this is a real gap in the Perl ecosystem...
perldoc -lf anomaly
2 direct replies — Read more / Contribute
by Anonymous Monk
on May 07, 2026 at 15:44
    Why does "perldoc -lf splice" return perlfunc and perlop when the word "splice" does not exist in perlop?
    % perldoc -lf splice                                                                             
    /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/pods/perlfunc.pod
    /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/pods/perlop.pod
    
    % grep 'splice' /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/pods/perlfunc.pod
    L<C<splice>|/splice ARRAY,OFFSET,LENGTH,LIST> has three scalar arguments
    ... (19 lines deleted for brevity)
    
    % grep 'splice' /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/pods/perlop.pod
    % <- NOTHING!
    
Where is the new perlootut?
3 direct replies — Read more / Contribute
by InfiniteSilence
on May 04, 2026 at 09:57
    shell> perldoc perlootut

    "...This document was created in February, 2011, and the last major revision was in February, 2013....

    I check metacpan...same document. I want to learn the latest techniques for OO in Perl. I remember reading that there were native classes added in 5.38. Is someone updating perlootut? Is is being superseded by another POD?

    Celebrate Intellectual Diversity

Regex question - identify which pattern comes first
3 direct replies — Read more / Contribute
by harangzsolt33
on May 01, 2026 at 20:12
    I feel like I have learned a lot in the past 10 years since I started learning Perl, but I still probably don't know more than half of what's possible using regex. I have often come across situations where I needed to identify which pattern occurs first in a string. So, I am not trying to capture a part of the pattern nor am I trying to identify if it occurs at all or where. I am just trying to figure our which of the possible patterns is FIRST in the string. For example:

    Sample string: "AB ABDA DCACCB AAA BSAA CAAB ACS ABA DBA BA DASSABACA A"

    I'm looking for either: BA[ABC]{2} OR CA[CD]{2} OR DA[SC]{2}

    So, I would write: /BA[ABC]{2}|CA[CD]{2}|DA[SC]{2}/

    Is there a way to get a return value of 1, 2, or 3 depending on which pattern was matched first? How would I do that?

Meditations
Threads, Tk, Time, oh my!
1 direct reply — Read more / Contribute
by choroba
on May 06, 2026 at 16:33
    It seems I've angered the god of threads, after years of him benevolently observing my adventures.

    I've updated my machines from openSUSE 15.6 to 16.0, which brought about system perl's jump from 5.26.1 to 5.42.0.

    I can't run my PerlMonks ChatterBox GUI client with threads anymore. It seems Time::Piece is no longer thread safe. I'm getting random segmentation faults and errors from Tk with missing characters, e.g.

    Tk::Error: bad text index "5.96" at /usr/lib/perl5/vendor_perl/5.42.0/ +x86_64-linux-thread-multi/Tk.pm line 251. k callback for .frame.rotext k::After::repeat at /usr/lib/perl5/vendor_perl/5.42.0/x86_64-linux-th +read-multi/Tk/After.pm line 80 [repeat,[{},after#45,1000,repeat,[\&PM::CB::GUI::__ANON__]]]
    which seems like there are strange things going on in the memory.

    Fortunately, MCE works without problems, so I still have 2 possible ways how to run the client.

    I know I'm no genius. It's possible the bug had been there in my code all the time and something just awakened it. So far, I haven't been able to simplify the code to reproduce the errors without all the non-related logic involved.

    (Tested with Tk 804.036, Time::Piece both 1.36 and 1.41).

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
PerlMonks Discussions
Perlmonks.com and Perlmonks.net to redirect to Perlmonks.org
1 direct reply — Read more / Contribute
by Co-Rion
on May 08, 2026 at 03:48

    As discussed in Moving the site behind a CDN, we will soonish move forward with moving the site behind Fastly. In conjunction, the domains perlmonks.com and perlmonks.net will also redirect to perlmonks.org, to improve cache hit rate.

    At least during the move the css.* domain will be unavailable, but as far as I understand the setup, we can later make css.perlmonks.org work again, especially for logged-in users.

    For the time being, you can update your bookmarks to perlmonks.org and save the login cookies for that domain.

    As for the timeline, the work is done by volunteers. I expect the DNS update and HTTP redirects to happen sometime next week.