I can't really figure this one out, please help.

I have a whole bunch of modules that layer on each other and I decided to try to use Mojo::Promise to go async. After running into issues I tried to mock some code on the command line and both M:P and Future do the same in that the inner "then"s do not seem to do anything.

```
sub outer{my $p=inner()->then(sub{say "o"}); $p}
sub inner{my $p=Mojo::Promise->new->then(sub{say "i"});$p->timer(1); $p}
outer->wait();
```

prints o only.

The Perl 5 Porters have released #Perl versions 5.40.2 and 5.38.4 to address CVE-2024-56406. It is believed that this #security #vulnerability can enable Denial of Service or Arbitrary Code Execution attacks on platforms that lack sufficient defenses.

You can soon download both from your favorite #CPAN mirror or find them at:

https://metacpan.org/release/SHAY/perl-5.40.2/

https://metacpan.org/release/SHAY/perl-5.38.4/

Changes are listed in their respective “perldelta” documents:

https://metacpan.org/release/SHAY/perl-5.40.2/view/pod/perldelta.pod

I'm still struggling building a development chain for a #PERL application (a REST-API server), that I'm writing on my notebook and want to ship on several air-gapped production servers.
I cannot run container images on target servers, so docker/podman are a no go.

To avoid problems with dependencies, I heavily searched for some "bundler" (like #esbuild I'm using for Node), but I failed 😠 . I met #carton but as it need to be run on production, this is a no-go as well...

Any suggestion?

@nixCraft #perl developers: $_

I built the second-worst #ZXSpectrum emulator in the world with #Perl

Huh, is there no way to have perltidy make sure there is a space after the number sign in the beginning of a comment? #perl

# like this
#not like this

@bbatsov #Perl is alive and well. :D

Just noticed that #Perl got a new cool (somewhat official) logo https://perladvent.org/2024/2024-12-23.html

I haven't used it in ages and I'm guessing it's mostly dead these days, but it was one of the first languages that got me really passionate about programming and it will always have a special place in my heart.

My take on IO bound thread performance in #Perl and #Python.

@zimzat
I can't imagine OCR having that problem with #perl

@ramuuns

😪 Tired: “Perl, aka write-only code”, “Perl is write-only language”, et al.

🤓 Wired: I can produce write-only code in any language, not just #Perl 😅 However I choose not to 🤷­ Because best case I have to read it again, and worst case my employers and customers know where I live 🙃

🚀 Inspired: Maintaining an inherited large #opensource Perl project with 120+ contributors since 12 years, and intending to continue for the next 12 years too.

@nedbat
Deciphering the #perl code I wrote last week is one of my favorite things to do

seeing languages like #javascript and #php have complicated problems with type comparisons makes me think that perhaps #perl got it right by having one set of operators for numeric comparison (<,==,>,<=> etc.) and another for string comparison (lt,eq,gt,cmp etc.)

@alexander_schoch “At first glance, #Perl looks like PHP and bash had a child, which is not something I’d expect in a #programming language.”

What if I told you it was the other way around?

- Perl dates back a full two years before #Bash, originating as a better text manipulation option than #Unix commands while still looking familiar to #shell scripters
- #PHP dates from the mid 1990s, when it was heavily inspired by Perl, though with much more inconsistent syntax

For 2024, I solved Advent of Code in 25 different languages. Was a fun project, sometimes a bit (very) painful (*glances at Erlang and Zig*).

Code (bottom of post) and summary for each language:
https://blog.aschoch.ch/posts/aoc-2024

Keep in mind that I used most of these language for a few hours tops, so my judgement is very much subjective.

What's your favourite of the bunch?

You triggered one of my pet peeves, so here's how I built and installed AnyEvent::Discord on a new Debian 12 (stable, bookworm) virtual machine from scratch.

I start by installing the packages you listed:

sudo apt install libmodern-perl-perl libanyevent-irc-perl \
  libfile-slurper-perl libmojo-sqlite-perl libmojolicious-perl \
  libdatetime-perl libkeyword-simple-perl libtest-fatal-perl \
  libtest-requires-perl libdevel-callparser-perl libtrue-perl \
  libperlx-define-perl libperlx-assert-perl \
  libmoox-late-perl libmoose-perl liblexical-accessor-perl \
  libnamespace-sweep-perl libreturn-type-perl libmatch-simple-perl \
  gcc-aarch64-linux-gnu dh-make-perl

and then I also install these packages that I found were needed, and packaged in Debian, along the way:

sudo apt install perl-xs-dev libmoosex-mungehas-perl \
  libclass-tiny-antlers-perl libmoosex-types-common-perl \
  libtypes-xsd-lite-perl libtest-warnings-perl \
  libanyevent-websocket-client-perl

Whenever I can't find a Debian package of the Perl library I need, I do dh-make-perl --cpan Library, debuild, and then sudo apt install ./library.deb - when a dependency is missing, I branch out and make/build/install that first.

First dependency missing is Moops:

dh-make-perl --cpan Moops
cd libmoops-perl/
debuild

Ok, Parse::Keyword is missing, so build that and install it:

cd ..
dh-make-perl --cpan Parse::Keyword
cd libparse-keyword-perl/
debuild
cd ..
sudo apt install ./libparse-keyword-perl_0.10-1_amd64.deb

Now Kavorka is missing, so build and install:

dh-make-perl --cpan Kavorka
cd libkavorka-perl
debuild
cd ..
sudo apt install ./libkavorka-perl_0.039-1_all.deb

Finally we can build Moops and install it:

cd libmoops-perl
debuild
cd ..
sudo apt install ./libmoops-perl_0.038-1_all.deb

Trying debuild in AnyEvent::Discord again, we are now missing Algorithm::Backoff::Exponential, so build that:

dh-make-perl --cpan Algorithm::Backoff::Exponential
cd libalgorithm-backoff-exponential
debuild

ah, it depends on Test::Number::Delta, so build that and install it:

cd ..
dh-make-perl --cpan Test::Number::Delta
cd libtest-number-delta/
debuild
cd ..
sudo apt install ./libtest-number-delta-perl_1.06-1_all.deb

so now we can build and install Algorithm::Backoff:Exponential:

cd libalgorithm-backoff-exponential/
debuild
cd ..
sudo apt install ./libalgorithm-backoff-perl_0.010-1_all.deb

and finally we can build and install AnyEvent::Discord:

cd libanyevent-discord/
debuild
cd ..
sudo apt install ./libanyevent-discord-perl_0.7-1_all.deb

Let's try:

asjo@debian:~$ perl -E 'use AnyEvent::Discord; say $AnyEvent::Discord::VERSION'
0.7
asjo@debian:~$ 

It's a little bit tedious, but if you maintain your own local Debian package repository (I use reprepro) it's quite manageble, and you get security updates automatically from Debian for Perl, and all the packages you didn't build yourself, automatically.

On the new laptop, I tried to build a module of mine that had all the dependencies in Debian packages except for one. Hey, dh-make-perl does this, right?

Well, kind of. Here's how far I got before I gave up with AnyEvent::Discord. Imagine an attempt to build stuff for every two or three items. And now more than an hour later I'm just angry and unhappy and have nothing to show for it except for this lousy post.

This is why the next time I want something built I will start with Perlbrew, installing Perl from scratch, into my home directory.

#Perl

sudo apt install libmodern-perl-perl libanyevent-irc-perl \
  libfile-slurper-perl libmojo-sqlite-perl libmojolicious-perl \
  libdatetime-perl libkeyword-simple-perl libtest-fatal-perl \
  libtest-requires-perl libdevel-callparser-perl libtrue-perl \
  libperlx-define-perl libperlx-assert-perl \
  libmoox-late-perl libmoose-perl liblexical-accessor-perl \
  libnamespace-sweep-perl libreturn-type-perl libmatch-simple-perl \
  gcc-aarch64-linux-gnu dh-make-perl
dh-make-perl --build --cpan Parse::Keyword
sudo dpkg -i libparse-keyword-perl_0.10-1_arm64.deb
dh-make-perl --build --cpan Kavorka
sudo dpkg -i libkavorka-perl_0.039-1_all.deb
dh-make-perl --build --cpan Moops
# fuck this shit
dh-make-perl --build --cpan AnyEvent::Discord
sudo dpkg -i libanyevent-discord-perl*

@gosha A quote from the book that I think you'll like, @ChristosArgyrop :

"If lisp is the result of taking syntax away, Perl is the result of taking syntax all the way." [p.342]
#lisp #perl

Perl camel.

@rmloveland I really like @oalders’s new logo too! Sorry, @kraih, I think your #Perl5 raptor is out.

/ @perl

I like the proposal for a new #perl logo!

I need #perl help for a minute. I have files in /tmp/ of the pattern "poster-123456.jpg" where 123456 is a random number of digits.

I want to remove all those files older than one hour.

Does this short routine do it (safely)?

sub removeOldPosters
{
my $keep_as_of = time - 3600 ;

my @old_files = (
grep{ !-d
&& /poster-[\d]+\.jpg$/i
&& ( stat( $_ ) )[9] < $keep_as_of
}
glob( "/tmp/*" )
);

unlink @old_files;
}
@tewha

#Perl @PerlWChallenge 296 Task 1: String Compression
#noxp
```
perl -E '
for(@ARGV){$x=$_; $x=~s/(.)(\1+)/$1.(1+length $2)/ge; say "$_ -> $x"}
' abbc aaabccc abcc
```

@tychotithonus @philsplace I do it in #Perl as well. In #BBEdit, this is my current open documents list. ONE python script cos #Plex tools are few and far between...and that build.sh? That's to build FFMPEG and associated libraries. The rest? Perl. 🤷‍♂️

Also, please don't criticize my naming convention(s). I don't have one...😂