@samhenrigold it's a ploy by big #Perl to sell more regexes
tags: #perl
to: https://hachyderm.io/users/samhenrigold
The try/catch feature in #Perl is weird.
Not in any functional way, mind, it's great that we don't have to eval anymore, and so on.
But the lack of `my` when spawning the error variable grinds my strict gears real bad.
```perl
try {
die "sutin";
} catch (my $err) {
say "died of $err";
}
```
is a grave error and the compiler complains:
> Can't redeclare "my" in "our" at -e line 1, near "(my"
> syntax error at -e line 1, near "(my "
It sticks out like a sore thumb.
tags: #perl #programming
to: https://a.gup.pe/u/perl https://relay.fedi.buzz/tag/perl
Here's an excellent tutorial by Paul Cochrane on building Map::Tube modules for Perl. If you're looking to create route-finding functionality for public transit systems, this is a great starting point. Paul walks us through setting up a module from scratch using test-driven development to implement a tram network for Hannover, Germany.
This is part one of a five-part series.https://www.perl.com/article/building-map-tube-maps-a-howto-first-steps/
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?
tags: #perl
to: https://mastodon.social/users/nixCraft
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
tags: #perl
to: https://hachyderm.io/users/bbatsov
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.
Get in loser. We're rewinding the stack.
group: inks@inks.tedunangst.com
tags: #inks #perl #programming #series #wasm
tags: #perl
to: https://mastodon.social/users/zimzat https://toot.ramuuns.com/users/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.
tags: #perl
to: https://hachyderm.io/users/nedbat
@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.)
tags: #bash #perl #php #programming #shell #unix
to: https://linuxrocks.online/users/alexander_schoch
@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.
griping about Debian and Perl
tags: #perl
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.
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*
https://en.wikipedia.org/wiki/File:Spinal_Tap_-_Up_to_Eleven.jpg
tags: #lisp #perl
to: https://mastodon.social/users/ChristosArgyrop https://merveilles.town/users/gosha
@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.
tags: #perl #perl5
to: https://a.gup.pe/u/perl https://fosstodon.org/users/kraih https://fosstodon.org/users/oalders https://mastodon.social/users/rmloveland
@rmloveland I really like @oalders’s new logo too! Sorry, @kraih, I think your #Perl5 raptor is out.
/ @perl
https://perladvent.org/2024/2024-12-23.html
tags: #perl
I like the proposal for a new #perl logo!