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 PerlMonks 30 Thu Apr 30 18:04:32 2026 Anonymous Monk 20260430180432 2026-05-03 22:04:32 clean,rss Thu Apr 30 18:04:32 2026 961 http://perlmonks.org/ Regex question - identify which pattern comes first harangzsolt33 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167676 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 ... perlquestion Sat, 02 May 2026 00:12:00 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167676 11167676 1166559 2026-05-01 20:12:00 harangzsolt33 Healing Debian Perl (and whatever else is broken out there) Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167674 Apparently some package installers on some systems like Debian fail to create .packlist files for installed modules! This policy oversight breaks critical parts of the perl toolchain that depend on co... perlmeditation Fri, 01 May 2026 11:15:18 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167674 11167674 961 2026-05-01 07:15:18 Anonymous Monk Re^3: Regex question - identify which pattern comes first (named captures) LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167692 You might want to correct this &gt; (?: Cheers Rolf (addicted to the Perl Programming Lan... note Sun, 03 May 2026 21:29:02 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167692 11167692 708738 2026-05-03 17:29:02 LanX Re^2: Regex question - identify which pattern comes first (named captures) ikegami http://perlmonks.org/~perl2/bare/index.pl?node_id=11167691 Adjusted for OP: if ( $str =~ / (?: (? BA<a href="?node=ABC">ABC</a>{2} ) | (? CA<a href="?node=CD">CD</a>{2} ) | (? DA<a href="?node=SC">SC</a>{2} ) /x ) { my $first = substr( ( keys( %+ ) )&#91;0&#93;, 1 ); ... note Sun, 03 May 2026 15:53:56 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167691 11167691 381608 2026-05-03 11:53:56 ikegami Re^5: copyfail challenge: making Perl version smaller Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167690 Picking apart an obviously humorous post is actually trolling, or a symptom of an all too common psychological disorder, take your pick. Now back to our regularly scheduled... note Sun, 03 May 2026 15:40:53 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167690 11167690 961 2026-05-03 11:40:53 Anonymous Monk Re^4: Installation of 2 module prerequisites failing - using cpanm LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167689 &gt; I am capable of learning from past mistakes Well, actions speak louder than words. &#129335;&#127995;&#8205;&#9794;&#65039; Maybe convince us by replying to those who are sti... note Sun, 03 May 2026 12:07:51 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167689 11167689 708738 2026-05-03 08:07:51 LanX Re^4: copyfail challenge: making Perl version smaller LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167688 Trolly... ... note Sun, 03 May 2026 11:59:34 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167688 11167688 708738 2026-05-03 07:59:34 LanX Re^4: Installation of 2 module prerequisites failing - using cpanm hippo http://perlmonks.org/~perl2/bare/index.pl?node_id=11167687 I also use Gnu/Linux systems and usually compare problems when they come up to see if I can reproduce the difficulty on Linux. Did you do that for the problem i... note Sat, 02 May 2026 22:29:24 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167687 11167687 885521 2026-05-02 18:29:24 hippo Re^3: copyfail challenge: making Perl version smaller (trillion dollar lolcow) Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167686 Duck.ai offers unpaid service. The quality of those models is obviously not the same. Obviously... The vulnerability in question was actually found with AI assistance. Actu... note Sat, 02 May 2026 18:23:30 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167686 11167686 961 2026-05-02 14:23:30 Anonymous Monk Re^3: Installation of 2 module prerequisites failing - using cpanm Intrepid http://perlmonks.org/~perl2/bare/index.pl?node_id=11167685 <a href="?node=LanX">Rolf</a> wrote: Multiple conflicting Perl installations and messed up environment variables are a recurring theme in many posts of this particular monk. Tha... note Sat, 02 May 2026 16:57:24 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167685 11167685 19724 2026-05-02 12:57:24 Intrepid Re: Regex question - identify which pattern comes first (named captures) LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167684 requires 5.10 for <a href="https://perldoc.perl.org/perlre#(?%3CNAME%3Epattern)">named capture groups</a>: This code will even give you the sequence. use v5.10; use strict; use warnings; my ... note Sat, 02 May 2026 15:18:08 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167684 11167684 708738 2026-05-02 11:18:08 LanX Reaped: Re^5: Regex question - identify which pattern comes first NodeReaper http://perlmonks.org/~perl2/bare/index.pl?node_id=11167683 This node was taken out by the <a href="?node=NodeReaper">NodeReaper</a> on May 02, 2026 at 16:26&nbsp;UTCReason: &#91;<a href="?node=LanX">LanX</a>&#93;: Reap: duplicate caused by lag-frustration-clickingYou may view &#91;href://?op=viewreaped;nod... note Sat, 02 May 2026 14:43:20 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167683 11167683 52855 2026-05-02 10:43:20 NodeReaper Re^5: Regex question - identify which pattern comes first LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167682 No the feature was already present in 5.8 <a href="https://perldoc.perl.org/5.8.0/perlre#(?%7B-code-%7D)">5.8.0/perlre#(?{ code })</a> I have another (simpler?) solution in mind which was pr... note Sat, 02 May 2026 14:43:11 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167682 11167682 708738 2026-05-02 10:43:11 LanX Re^4: Regex question - identify which pattern comes first harangzsolt33 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167681 No, the second solution did not work. But the first one does work, and I never thought of doing it that way even though I knew you could capture using the parentheses. I didn't know you can use define... note Sat, 02 May 2026 14:20:27 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167681 11167681 1166559 2026-05-02 10:20:27 harangzsolt33 Re^2: copyfail challenge: making Perl version smaller (trillion dollar lolcow) LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167680 Duck.ai offers unpaid service. The quality of those models is obviously not the same. The vulnerability in question was actually found with AI assistance. ... note Sat, 02 May 2026 13:42:35 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167680 11167680 708738 2026-05-02 09:42:35 LanX Re^3: Regex question - identify which pattern comes first LanX http://perlmonks.org/~perl2/bare/index.pl?node_id=11167679 &gt; that is an amazingly simple solution! Did you try it? These (??{ $first = 1; }) won't work because they'll include 1,2 or 3 into the regex. Try (?{ $first ... note Sat, 02 May 2026 13:28:33 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167679 11167679 708738 2026-05-02 09:28:33 LanX Re^2: Regex question - identify which pattern comes first harangzsolt33 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167678 Oh wow, that is an amazingly simple solution! Thank you so much!!! :-)... note Sat, 02 May 2026 02:15:03 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167678 11167678 1166559 2026-05-01 22:15:03 harangzsolt33 Re: Regex question - identify which pattern comes first ikegami http://perlmonks.org/~perl2/bare/index.pl?node_id=11167677 if ( /(BA<a href="?node=ABC">ABC</a>{2})|(CA<a href="?node=CD">CD</a>{2})|(DA<a href="?node=SC">SC</a>{2})/ ) { my $first = ( defined( $1 ) ? 1 : defined( $2 ) ? 2 : 3 ); ... } local our $first; / (?: BA... note Sat, 02 May 2026 01:53:06 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167677 11167677 381608 2026-05-01 21:53:06 ikegami Re: Healing Debian Perl (and whatever else is broken out there) Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167675 TIMTOWTDI, sorry it's late here, forgot to rewrite pipes as backticks: # archlib: The core .packlist perl -MConfig -e 'print `ls -la "$Config{archlib}/.packlist"`' perl -MConfig -e 'print `... note Fri, 01 May 2026 11:24:59 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167675 11167675 961 2026-05-01 07:24:59 Anonymous Monk Re^5: copyfail challenge: making Perl version smaller marto http://perlmonks.org/~perl2/bare/index.pl?node_id=11167673 "So we can trust open source modules? It's reasonable to expect you can trust something more if you have access to the source code, but you'd need to read and understand it, and the ... note Fri, 01 May 2026 08:33:04 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167673 11167673 324763 2026-05-01 04:33:04 marto Re: copyfail challenge: making Perl version smaller (trillion dollar lolcow) Anonymous Monk http://perlmonks.org/~perl2/bare/index.pl?node_id=11167672 You need to stop smoking those tokens bro. You did not fail, some robot failed. Confusing yourself with a pseudo-random text generator is a symptom of "AI" psychosis. Go touch grass man, but don't... note Fri, 01 May 2026 07:05:12 +0000 http://perlmonks.org/~perl2/bare/index.pl?node_id=11167672 11167672 961 2026-05-01 03:05:12 Anonymous Monk