mjgardner, (edited ) to programming
@mjgardner@social.sdf.org avatar

This is hilarious. A engineer invented to make command line scripting easier with , because at a certain point scripts get too complicated and you need a Real Language.

https://github.com/google/zx/

This is exactly ’s use case from thirty-six years ago. But the kids want everywhere and would rather it take more work to convert their ascended scripts to a vastly different syntax.

https://github.com/google/zx/issues/581#issuecomment-1516573139

leonerd, to random
@leonerd@fosstodon.org avatar

In a +1 score to 's great back-compatibility, I've had a script called from procmail that's been 100% reliable for the past 15 years maintaining my email, over many years of regular Perl updates.

A month ago it broke - because procmail. https://github.com/BuGlessRB/procmail/issues/5

But the perl itself still runs absolutely fine.

ChristosArgyrop, to Perl
@ChristosArgyrop@mstdn.science avatar

WTF is wrong with people and their hatred for #perl ?
@Perl

image/jpeg

fuzzix, to random

Watching some of the vids coming out of this year's Perl and Raku Conference. Ingy döt؜؜ Net­'s talk on his work on Lingy and YAMLScript was pretty amazing.

Lingy is a hosted on - Perl code can call Lingy code can call Perl code. The idea of having a Lingy VM with JIT is very appealing.

YAMLScript is a YAML-style dialect of Lingy (or any Clojure implementation), for those who don't like LISP style.

Check the talk out here: https://youtu.be/9OcFh-HaCyI

timbray, (edited ) to random
@timbray@cosocial.ca avatar

Dear world, I need to hire someone expert in installing & configuring some open-source software on MacOS. Currently my blogging system breaks every time I type "brew upgrade" and I am out of patience. [EDIT: Problem solved.]

Tl;dr: I need to arrange that this 2-line Perl program works and survives updates:

use DBI;
use DBD::mysql;

Will pay an appropriate hourly rate. Private-message or email me.

#perl

tshirtman, to random French
@tshirtman@mas.to avatar

Me: "hm, there is no curl or wget in this image, and i’m not root, what can i use to download a binary, oh there is /bin/perl, surely downloading something with that should be possible"

perl: "get.pl died at line 4"

"Thanks #perl really useful error message.

Ah, debugging is apperently done with -d"

next
next
next
next

"get.pl died at line 4"

Geez, I wonder why i didn’t learn this language before.

phryk, to random
@phryk@mastodon.social avatar

I've been trying for 1.5 hours now to figure out how to use a debugger in and am reminded once again that this entire language is an enormous fucking garbage fire, especially considering documentation.

dakkar, to Perl

At $work, we just fixed a tiny bug by adding a use Try::Tiny and a semicolon.

A colleague asked «how did it even compile, before?»

Well, welcome to another weird corner of #Perl!

So, when neither try nor catch are declared, the source:

try {
    print "in try";
} catch {
    print "in catch";
}

return 42;

is parsed as```
(print "in try")->try((print "in catch")->catch(return 42));


because of the **Indirect Object Syntax** (the thing that makes `my $obj = new Class @args` equivalent to `my $obj = Class->new(@args)`, and also allows `print { $filehandle } @values`)  
  
«but wait!», you’ll say, «why am I not getting `Can't locate object method "try" via package "1"`?» (after all, `print` returns 1, and `sub 1::try` is definitely not there)  
  
and the answer is: the missing semicolon!  
  
see, before looking up a method, perl evaluates all its arguments, in order from left to right. So it first evaluates `print "in try"`, then `print "in catch"`, then `return 42`, at which point the control returns to the caller *and neither `try` nor `catch` are ever looked up*!  
  
Indeed, if you run:```
sub thing {
    try {
        print "in try";
    } catch {
        print "in catch";
    };

    return 42;
}
thing;

(notice the semicolon before return!) you'll get (pardon the newlines):```
in try
in catch
Can't locate object method "catch" via package "1"


  
and the program dies.  
  
Maybe I should mandate `no indirect` in all our files…  
  
@Perl@chirp.social
rrwo, to Perl

Is anyone else having issues with #Perl upgrading modules on #CPAN?

It seems like the 02packages.details.txt files are not being properly updated with newer versions of some modules that are on @metacpan recent.

@Perl

Edit: I find that searching for modules on MetaCPAN also shows older versions. Is there a problem with indexing new uploads?

ck, to random
@ck@noc.social avatar

Inside a #Perl script I wanted to compare an input string against an array of strings. When the input exactly matches against one of the array items, then print that a match was found.

One way to solve this is to use the Perl-internal grep function (similar in behaviour to the grep Shell command, but not exactly the same).

https://www.claudiokuenzler.com/blog/1335/how-to-grep-exact-string-match-perl

tripleo, to random
@tripleo@fosstodon.org avatar

All you nutcases still using , what's actually wrong with it?

aka What are the sharp edges?

rrwo, to Perl

Is there a equivalent of pytrends for querying the Google Trends API?

@Perl

sourcerer, to random

So i spend my weekend with LFS, and source mage... but now again i think about trying #perl

Why not? Every install have perl.

I'm really curious, somebody knows details why perl is still alive? Why it's needed?

https://tldp.org/HOWTO/Software-Building-HOWTO-7.html

smonff, to Perl French

Twelve years I started with Perl and I still can't remember EVERY TIME which one between ^ and $ should be used to match begin and end of regex pattern 🤔

Any mnemonic or memory aid? I can use a cheat sheet, but come on…

@Perl

mjgardner, to programming
@mjgardner@social.sdf.org avatar

@Perl Happy 36th #birthday to the #Perl #programming language!

v1.0 then:
“Perl is kind of designed to make #awk and #sed semi-obsolete […] The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).” https://github.com/Perl/perl5/releases/tag/perl-1.0

v5.38.2 now:
“Perl is […] now used for a wide range of tasks including #SysAdmin, #WebDev, network programming, #GUI development, and more.” https://perldoc.perl.org/perlintro#What-is-Perl%3F

ovid, to random
@ovid@fosstodon.org avatar

We just bumped a client from version 5.16 to Perl version 5.32.

It feels great to be updating things to a modern Perl.

scruss, to RegEx
@scruss@xoxo.zone avatar

perl -pwle 's|(?<=,)(\d+)(?=>)|sprintf("%.0f", 440*2**(($1-34)/12))|eg;'

... perfectly normal regex skillz, no?

mjgardner, (edited ) to Perl
@mjgardner@social.sdf.org avatar

Count the number of binary bits of difference between two characters in :

% 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

richlv, to Kubernetes
@richlv@mastodon.social avatar

Hey #Kubernetes / #Perl community - is https://github.com/kubernetes-client/perl/ dead?

Last meaningful commit seems to be 4 years ago.

ChristosArgyrop, to programming
@ChristosArgyrop@mstdn.science avatar

Popularity of languages from August ( is 28 at 0.68%).
Has its limitations, but a couple of points worth noting :

  1. and are holding rather well
  2. languages that are involved in some sort of data analysis and processing (, /c++) are doing very well. Not sure what to make of ; are ppl in seeing through the reality is a scripting over extremely performant c/c++ and that there are other lang that can glue as well?
    & are ⬆️
nuddlegg, to programming
@nuddlegg@fosstodon.org avatar

Being faced with bad code people tend to blame more the programming language than the devs that wrote the code. #perl #programming

nixCraft, to linux
@nixCraft@mastodon.social avatar

Here is how to install Perl in Fedora , including the latest version of mod_perl with Apache (HTTPD) to run dynamic web pages/handlers in Perl https://www.cyberciti.biz/faq/install-perl-in-fedora-linux-using-dnf-command/

rrwo, to random

@Perl

Does anyone have experience changing a application to use subroutine signatures? (Especially with the controllers?)

At work there's a concern/superstition that the method attributes may conflict with signatures.

ferki, to Perl
@ferki@fosstodon.org avatar

Inspired by a 2013 tweet from @garu, I end up querying GitHub for basic #Perl project stats from time to time out of curiosity.

Here are the data points I have so far:

  • 2013-09-07: ~50k repos, 11 with >500 stars, 2 with >1k stars

  • 2021-11-09: ~133k repos, 129 with >500 stars, 56 with >1k stars

  • 2023-11-11: ~125k repos, 156 with >500 stars, 74 with >1k stars

The query used is like language:Perl stars:&gt;500

Sharing in hopes others find it interesting.

/cc @Perl

dboehmer, to Perl

@Perl I have a hard time getting this database query to work with DBIx::Class. I gave my best to describe it in a useful way. I’d very much appreciate any hints or questions:

https://stackoverflow.com/questions/77558505/use-function-value-from-subquery-in-where-clause-fetch-it-with-results-using-d

#perl #dbixclass #dbi

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines