#perl
Hash register: my (late) Raku solution to Task 1: Exact Change from The Weekly Challenge #236 https://rcmcintosh.blog/2023/10/02/hash-register-my-solution-to-task-1-exact-change-from-the-weekly-challenge-236/
@FediFollows Please add https://chirp.social/@Perl, a Fediverse discussion group about the #Perl programming language, to https://fedi.directory/tag/fediverse-groups/
Thanks!
#Perl @PerlWChallenge 237 Seize The Day and Maximise Greatness https://wlmb.github.io/2023/10/01/PWC237/
#noxp
#Perl @PerlWChallenge 237 Task 1: Seize The Day
#noxp
```
perl -MPDL -E 'print "@ARGV -> ";$d=pdl[[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,
31,31,30,31,30,31]];$s=pdl[[0,3,3,6,1,4,6,2,5,0,3,5],[0,3,4,0,2,5,0,3,6,1,4,6]];($y,$m,$w,$n)=@ARGV;
--$w;--$m;$n%=7;$y%=400;$l=(floor(($y+3)/4)-floor(($y+3)/100))%7;$r=($y+$l+6)%7;$g=($y==0|| ($y%100
!=0 && $y%4==0))||0;$b=($s->at($m, $g)+$r)%7;$q=1+($n-$b)%7+$w*7;$q=0 if $q>$d->at($m,$g);say $q;
' 2024 4 3 2
```
@jazz I believe I used isync years ago when I want do offline IMAP with mutt while traveling with a laptop.
<checks notes>
Nope, I used `offlineimap`, with a laptop with 8 MB of memory, a 75 Mhz processor and a 400 MB hard drive.
I set it up a CLI-only device. Mutt was pretty snappy on it. I did a little #Perl development on it too..

If you've a background in #C and #Perl and have thought about contributing to the Perl core, you know it's daunting hacking on the core of a language.
@leonerd is offering to help you learn.
https://www.nntp.perl.org/group/perl.perl5.porters/2023/09/msg267112.html
Also, he's written a tutorial on how to contribute a core feature: https://leonerds-code.blogspot.com/2021/02/writing-perl-core-feature.html
@julie I use the #Mojolicious modules, Mojo::UserAgent + Mojo::DOM for web scraping in #Perl. Makes it so easy. 😀
The Weekly Challenge 236: Change for the Machines #Perl #Raku #Rust #Postscript #PerlWeeklyChallenge #BlogFiredrakeOrg https://blog.firedrake.org/archive/2023/10/The_Weekly_Challenge_236__Change_for_the_Machines.html
My #LongCovid addled brain has caused me to take two days to realise that #perl 's "read" command ( https://perldoc.perl.org/functions/read ) the "OFFSET" relates to the provided scalar and not the file being read in (which you would need seek for).
So I've discovered that voice control for computers has come a long way. I started learning perl a couple days ago, and I stumbled upon a video where somebody uses software called Talon to program in perl. So far I don't have severe RSI, but I feel like it will grow as I get older.
Here is one of the videos I saw that motivated me to try this: https://www.youtube.com/watch?v=YKuRkGkf5HU
First day working by myself at the new job. Troubleshot the 18 different places Windows hides startup applications, and a Facilis Terrablock RAID whose boot drive was listed in the "Safely Remove Drive" tray icon. Set up a new Ubuntu box, learned a touch of Perl from some custom scripts, and fixed a broken drive formatting script which turned out to be due to a single uncaught period in a sed command.
I'm tired.
@shawnhcorey @wh0x3r
@Perl #Perl’s roots are repeatedly acknowledged in the official documentation available via the `perldoc` command, man pages on #Unix-ish systems, and the web:
* https://perldoc.perl.org/perl#:~:text=DESCRIPTION-,It%20combines,Unix%20users
* https://perldoc.perl.org/perlfaq1#:~:text=What%20is%20Perl#3F-,Perl%20derives%20from,many%20other%20tools%20and%20languages
* https://perldoc.perl.org/functions/grep#:~:text=This%20is%20similar,and%20its%20relatives
I am annoyed how fashion dictates which languages are used to build tools. First, everything was in #Ruby (with its gem hell), then #JavaScript (and gems seem so cool in comparison to npm), and now everyone uses that primitive #goLang.
Although at least it comes as a single binary, so that's an improvement of sorts.
P.S. And before Ruby, it was #Perl, the write-only language.
While Fastly is blocking me, a question for the #Perl community.
How do I loop over a blessed array (got it from an API)? :)
Guide on how to install Perl on Debian 12 Bookworm via APT or via compiling the source. https://www.linuxcapable.com/how-to-install-perl-in-debian-linux/ #linux #debian #perl #opensource #linuxtips
Custom TCP Test Harness in Perl
https://two-wrongs.com/custom-tcp-test-harness-in-perl
Hello!
I am pleased to announce a new version of my "Perl One-Liners Guide" ebook.
Links:
* PDF/EPUB versions: https://learnbyexample.gumroad.com/l/perl-oneliners or https://leanpub.com/perl-oneliners/c/new_perl_release (free till 07-October-2023)
* Web version: https://learnbyexample.github.io/learn_perl_oneliners/
* Markdown source, example files, etc: https://github.com/learnbyexample/learn_perl_oneliners
Bundle offers:
"All Books Bundle" is $12 (normal price $32) — includes all my 13 programming ebooks.
* https://learnbyexample.gumroad.com/l/all-books/new_perl_release
* https://leanpub.com/b/learnbyexample-all-books/c/new_perl_release
I would highly appreciate it if you'd let me know how you felt about this book.
Happy learning :)

Scalable CSS, How Regexes Work, and Adding Python types
#css #RegularExpression #perl #python
👉 Please retweet if you ❤ Plurrrr. Thanks! 👍
@JordiGH this is like what started me on #Perl.
The oreilly #regex book used Perl in the examples so I thought Perl was how one used regexes
Granted, Randall didn’t do me any favors with this comic https://xkcd.com/208/
@Codeberg A core requirement of #inxi is that it always works on everything, going back to about 2005-2008. The only hard requirement is #Perl 5.008 or newer. inxi is in #Debian sid, which can be accessed via pinning to stable and adding sid sources, or you can just replace inxi package with inxi files, there's no difference really. Each new inxi tends to have a lot of new stuff, and new hardware etc support.
Moving from a #Python -based codebase to a #Perl -based one to download Copernicus images, I found a reduction of the VIRT memory from about 7GBs to about 2GBs and from 2 threads to whatever I like. The Python code base uses sentinelsat and homura packages for REST downloads from the #copernicus service. I wonder how this difference in memory footprint could be justified. 🤔
I write an awful lot of .pbm/.pgm/.ppm files when doing image extraction or creation with #Perl - it's just about the simplest possible image format (header w/ type, width, height, then just blast the pixel values), and then is easily fed to the NetPBM tools to turn it into something else like a .png.
.PAM files are "newer" (~2000) and support alpha channels and >8 bit channel depth. pamtopng does exactly what it says in the name, but I have to build it from scratch first!

@Perl Here is a find + #Perl command for #macOS that will check which installed #Electron-based applications have not yet been updated against this month's #libwebp #CVE20234863 #security vulnerability: https://social.sdf.org/@mjgardner/111126922716051872
Other apps may be vulnerable, this just checks the Electron ones!
It uses the built-in https://perldoc.perl.org/version API for parsing and comparing version numbers.

Please do not use the #ASCII grave accent (0x60) as a left quotation mark together with the ASCII apostrophe (0x27) as the corresponding right quotation mark (as in `quote'). Your text will otherwise appear rather strange with most modern fonts (e.g., on #Windows and Mac systems). Only old X Window System fonts and some old video terminals show ASCII 0x60/0x27 as left and right quotation marks, while most modern systems follow the ISO and Unicode standards instead. If you can use only ASCII’s typewriter characters, then use the apostrophe character (0x27) as both the left and right quotation mark (as in 'quote'). If you can use #Unicode characters, nice directional quotation marks are available in the form of characters U+2018, U+2019, U+201C, and U+201D (as in ‘quote’ or “quote”).
If you work in an environment where the UTF-8 encoding is already used everywhere (e.g., Plan9 and most modern GNU/Linux installations), you could even decide to use proper directional quotation marks, as in ‘quote’ or “quote”.
Check your source code directories with
grep \` *
to find out, where modifications are necessary. Then use (with proper care!) something like
perl -pi.bak -e "s/\`/'/g;" file1 file2 ...
to make the necessary substitutions automatically, or make the edits manually instead.
The use of 0x60 (grave accent) as a special control character in the Unix shell (to denote command substitution as in command or better $(command)), in #Perl, in #Lisp, or in #TeX/troff (to denote a proper left single quotation mark) does not have to be changed and remains unaffected
https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
#Perl @PerlWChallenge 236 Exact Change and Array Loops https://wlmb.github.io/2023/09/24/PWC236/
#noxp
A Perl centric #BTC milestone! A transacation was created and signed by Bartosz Jarzyna using the #Perl module Bitcoin::Crypto.
https://mempool.space/testnet/tx/f8990964483b62a86ad1a5ae445b2d5b3ccd74c3611a857dc794a37eb5c62e3f
Example code here: https://gist.github.com/bbrtj/ac016abfb360e4903b89ce4183409c59
@nxadm @vruz Would have been a neat alternate timeline if @gruber just used #Perl #POD instead of inventing #Markdown, but the former admittedly isn’t *quite* as aesthetic when viewed as plain text.
(As evidenced by the above sentence, which would have had to say I<quite> in POD for the same effect.)
Different times, different use cases: POD was invented in a world of man pages and ugly nroff codes; Markdown in web pages in ugly #HTML.
I think the feature-set is limited and I trust the knowledge of people introducing the change.
But it's a fact that most devs know some markdown nowadays (probably the GitHub dialect) and not many feel joy when they have to learn yet another documentation format limited to a single language.
Markdown is a rough idea and a moving target scribbled down by a blogger for his particular needs in his limited scope.
Any long-term work should be based on a better defined derivative such as CommonMark, Pandoc Markdown, Github's GFM, or Markdig.
I assume that's what they actually mean, and not "Markdown" literally, otherwise they're stepping into trouble.
Hell froze over? #Perl is thinking about moving from POD to Markdown for library documentation. I wish #rakulang would pay attention as well and go for the short pain.
"POD extensions - do we keep stealing features from Markdown (like tables, images, language markers)? Do we switch to Markdown? Neither are easy."
https://blogs.perl.org/users/psc/2023/09/this-week-in-psc-117.html
Oop is available in #perl since the beginning of forever.
Part of the core language. No addons required. Simple, true. Hash based, true. Far from perfect, true. Yet scales well even for large systems. Decent enough and just sitting there for people to write well structured code with it.
And that's the main reason for oop in the first place.
Refusing to structure code well or not is more of a dev's personal choice ... independent of the tools at hand.
@clf @nuddlegg Disagree that #Perl #OOP is messy. v5.38 finally gives people a familiar native syntax: https://perldoc.perl.org/perlclass
If you can’t use that, #Moo is quite nice:
• https://metacpan.org/pod/Moo
And #Moose gives you a full meta-object protocol:
• https://metacpan.org/pod/Moose
@mjgardner I could easily picture some of these memes saying:
#Perl spaghetti?...naw!
#JavaScript spaghetti?...cewl!
Kinda thing.
Being faced with bad code people tend to blame more the programming language than the devs that wrote the code. #perl #programming
@alexelcu Quite similar story.
I had #Amiga 500 back in 1992 and desperately wanted to learn programming. But being in the country I was, it was impossible to get tools and books. From 1997, when on PC, things got much better. Programming languages weren’t that bad … we had #Perl but the problem was that programming books were so expensive. It was a treat to buy new book every 6 months.
@heberle Consider following https://chirp.social/@Perl, the hub of the #Perl fediverse community. Followers tag it in their Perl-related posts to boost them to everyone else.
@ChristosArgyrop @Perl Author of the article has a nice #blog with a lot of #Perl posts: https://perlingresprogramming.blogspot.com/search/label/perl
And that video course is available in bite-size pieces on a new-ish bespoke Perl #YouTube channel: https://youtube.com/@perltechstack?si=UajWQzjfJVCyi26q
@ovid Few years ago I had a potential long-term #Perl client. We made a first small contract. In their #CGI hell I found they had #UTF8 in their database and told browsers to do so but both I/O were not configured. It seemed to work but internally all their strings were garbage. Nobody understood. Some string operations were done in #SQL because there it "magically" worked.
I tried to explain but they didn't understand or even believed me there was any issue at all. I do not miss that client.
I‘m an environmental #physicist by training, but after three years of parental leave I started a new job as a consulting software #developer. I work(ed) with a lot of different technologies: #swiftlang, #java, #csharp, #cplusplus, #angular, #perl, … My preferred computing platform is the #Mac.
In my spare time I love to play #tabletopgames of all kinds: #boardgames, #cardgames, #miniature games and #rpg’s. When I‘m by myself I also enjoy #sologames or (mostly) older #videogames.
@jriou Consider porting the #Perl to the community-supported #MongoDB client #Mango by @odc and @kraih: https://metacpan.org/pod/Mango
Here is an article from last year's Perl Advent Calendar about it: https://perladvent.org/2022/2022-12-05.html
@deadbeefmonster Follow https://chirp.social/@Perl and you’ll be able to exchange messages with the >400 members of the #Perl fediverse community that tag that account!
@sreagle Sort of a fediverse #JAPH? https://en.wiktionary.org/wiki/JAPH
Interested in #hacking, #socialengineering, #pentesting, #malware #development, #training and #helping people, #network #protocols, #ARM, good #food, and new #friends.
Also #retrogaming and #retrocomputing; #coding in #C, #C++, and #Perl, and guess that's about it these days but I can #code in 20+ languages; #TTRPGs as a DM/Storyteller/GM such as #DnD, #OSR, and #VtM ; #cooking; making #art like #painting and #watercolor; servers run #OpenBSD; fan of tinkering with #NetBSD; daily driver is #macOS; #horror and #scifi movies; and likely other things I'm forgetting.
Restarted learning #CommonLisp, too.
Fan of the #GratefulDead, #Phish, and #Goose.
@kpeace @Perl Save this as an executable #Perl script and then run it with two characters as command line arguments:
(I incorporated the `tr` counting tip from @dakkar: https://s.thenautilus.net/notes/9jx0aek4wo)
#!/usr/bin/env perl
@ordinals = map ord, @ARGV[0, 1];
$xor = $ordinals[0] ^ $ordinals[1];
$binary = sprintf '%b', $xor;
$count = $binary =~ tr/1//;
print "$count\n";
@pganssle @faassen Contrast that w/ #Lisp, #Python, #Ruby & #Perl which offer different ways of managing abstractions, namely macros & meta-programming.
They let you shrink the depth of the hierarchies by using those means.
And b/c of that the culture is generally against too granular abstractions.
―
⚠ In recent years, I've seen Python code bases inclining towards the Java approach (a la #Zope) and that is quite frightening 😑
3/3
∙ moving here from 🐦 https://twitter.com/Liskni_si
∙ software developer 🧑💻 (passionate about free and open-source software, but sadly in a proprietary/cloud software day job)
∙ live in London (🇬🇧), but Brno (🇨🇿) is my hometown
∙ #Debian #Linux 🐧 on a #ThinkPad 💻, for 18 years and counting (never reinstalled!)
∙ #bash, #Haskell, #Python, #Rust these days (alphabetical order); previously #C, #Elixir, #Erlang, #Perl, #TeX, …
∙ likely #neurodivergent ♾, possibly #ActuallyAutistic (yet to be diagnosed)
∙ love cycling 🚴, both urban (fixed) and sport (road/gravel)
∙ love rollerblading 🛼 even more, mainly urban and endurance, wannabe speed
∙ #metalhead 🤘
∙ #beer 🍺 connoisseur (of course, I am Czech after all)
#Perl’s backwards compatibility is stellar.
Writes @jwz: “I dug up the old CVS archive, checked out those old web site source revs, and then I had to run that website-generating perl script that I wrote 25 years ago...it worked without any modifications. Self-high-five.”
https://www.jwz.org/blog/2023/01/mozilla-orgs-25th-anniversary/
So I started a project to try to bring basic type constraints to #perl. https://github.com/Perl-Apollo/oshun
I named it "Oshun" after a Nigerian Yoruba river goddess who's often depicted as protecting humans. I did that because I wanted to show a world that's more "round," if you will.
It's a given that when you try to do something big in #OpenSource, you get detractors.
Here's a comment from one of mine:
"Oshin" (sic) is named after a pagan river demon/earth mother - speaking of "bizzare".
Geologist & physical geographer. Works with data analysis, data management and visualization within spatial data, GIS, remote sensing, metadata. Happy outside in Nature.
Likes #geoscience #environmentalscience #remotesensing #gis #FOSS #dataanalysis #geospatial #copernicus #OpenStreetMap #grassgis #qgis #GenericMappingTools #perl #python #gnuplot #imagemagick #spatial #OpenSource #openscience #datamanagement #datavisualization #Linux #amateurastronomy #running #cycling
Geolog & naturgeograf. Arbetar med dataanalys, informationshantering och visualisering inom geodata, gis, fjärranalys, metadata. Gärna ute i naturen på fritiden.
Gillar #geoscience #environmentalscience #remotesensing #gis #FOSS #dataanalysis #geospatial #copernicus #OpenStreetMap #grassgis #qgis #GenericMappingTools #perl #python #gnuplot #imagemagick #spatial #OpenSource #openscience #datamanagement #datavisualization #Linux #amateurastronomy #running #cycling
Needed a dynamic status page on some #embedded #pcengines #netbsd boxes, so thought I'd see if a #perl #nginx #fastcgi #daemon (with a pidfile & 'start', 'stop', status' etc) was quick to setup
Turns out: "yes"
#!/usr/pkg/bin/perl
use Daemon::Generic;
use CGI::Fast
socket_path => '127.0.0.1:8999',
listen_queue => 50;
newdaemon( 'progname' => 'statusd');
sub gd_run {
while ( $q = CGI::Fast->new ) {
process_request($q);
}
}
process_request() {
my $q = shift;
# code here
}
Hey, #Perl peeps. Lots of languages, such as #go, #rust, and #node, have core tools to make it trivial to contribute open-source code.
I think Perl needs that, too. Here are my rough thoughts. https://gist.github.com/Ovid/05b69b8fa266e6d6b3600479871074b1
I would love to hear feedback.
Currently (ab)using DBIC in/deflators, Moose `around` method modifiers and some poor JSON to implement a simple way to localize data in a previously single-language app. #Perl
🌟 This is the official Mastodon account for LemonLDAP::NG, a Web Single Sign On free software compatible with many open standards like CAS, SAML and OpenID Connect.
ℹ️ We will publish here information about releases and new features. Please follow us!
🌐 See also our official website: https://www.lemonldap-ng.org
#introduction #lemonldap #lemonldapng #SSO #WebSSO #CAS #SAML #OpenID #OpenIDConnect #OIDC #OpenSource #FreeSoftware #LogicielLibre #Perl
yup, looks like the new built-in OO #Perl is working. Dunno what else anyone could possibly want. :)
https://github.com/jhannah/sandbox/blob/main/jhannah/perl-class-poker/poker.pl cc/ @silverwizard @ovid @perigrin
A not-so-short list of things I learned at PerlKohaCon #Perl #Koha http://domm.plix.at/perl/2023_08_things_i_learned_at_perlkohacon.html
@randomgeek @joelle @Perl I’d like that to be true for me, but I have yet to personally face one of those tasks that #RakuLang can do but #Perl can’t.
I need more than just someone else’s subjectively “better” expression of the same task.
@joelle @Perl @AFresh1 @leonerd #RPerl and various other qr/perl/i efforts are inevitably driven by self-aggrandizing lone devs (plus entourage) with BDFL designs on the One True #Perl that only runs the subset they care about.
They either forgot or never learned the @ietf motto: “We believe in rough consensus and running code.”
20 years ago is a long time and a lot has changed since then.
You don't need any #Perl nowadays, but it's (despite its fall into almost total oblivion) still my favourite programming language.
Slides for my 3 talks at #Perl #Koha Con 2023 are now available:
* Deploying apps using podman and ansible: https://domm.plix.at/talks/deploy_podman_ansible.html
* OpenAPI, Perl & Koha: https://domm.plix.at/talks/openapi.html
* Koha Geosearch: https://domm.plix.at/talks/koha_geosearch.html
#potd 28h exposure of Helsinki Cathedral via Puck, from #Perl #Koha Con 2023 http://domm.plix.at/potd/2023-08-17.html
Day 3 of #Perl #Koha Con in Helsinki will start soon: https://perlkohacon.fi/
(I've got a talk in the first slot)