#Perl
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.
The Weekly Challenge 235: One, Zero #Perl #Raku #Rust #Postscript #PerlWeeklyChallenge #BlogFiredrakeOrg https://blog.firedrake.org/archive/2023/09/The_Weekly_Challenge_235__One__Zero.html
@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
Final test scripting for my new #Perl codebase to access and download data from the new #Copernicus #dataspace #CDSE. Time to retire my old code based on #sentinelsat package that will stop working in a week or so. Thanks Copernicus folks, changing APIs every few years is a great way to make people happy. 😞
* https://github.com/sentinelsat/sentinelsat
* https://dataspace.copernicus.eu/analyse/apis
* https://scihub.copernicus.eu/

@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";
Count the number of binary bits of difference between two characters in #Perl:
% perl -E 'say scalar @{[ sprintf("%b", ord "D" ^ ord "C") =~ /1/g ]}'
3
Explanation:
1 . `ord` gets characters' code points
2. `^` XORs them (1 bit for each different bit)
3. `sprintf` to binary string
4. `=~ /1/g` matches every 1
5. `[`…`]` creates array reference so list context captures every match
6. `@{`…`}` dereferences to array
7. `scalar` counts array elements
8. `say` outputs result
何故かPerlの投稿は日本語なのに外国の方に速攻で捕捉されています。 #perl
@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
#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)
@domm @leobm @miyagawa Look into @oalders’ OrePAN2 and supporting tools for a lightweight way to maintain a “DarkPAN” that can act like a private #CPAN mirror for internal-only #Perl module distributions: https://metacpan.org/pod/OrePAN2
You can “inject” your private modules from a local or remote tarball or git repo: https://metacpan.org/dist/OrePAN2/view/script/orepan2-inject
Then you use cpanm, carton, etc. with your DarkPAN as one of the mirrors to search for dependencies.