med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

355
active users

#perl

9 posts8 participants0 posts today

Love this article on the importance and philosophy of Perl

wired.com/story/programmers-ar

I have to use Python and Go which both feel less interesting and creative. I love when we lean into how the world is, sloppy and unpredictable. I loathe people and designs that attempt to control or perfect the world.

I absolutely love Perl. The world is a darker, much less interesting place if we've decided to dumb down our programming languages. Language impacts the way we think about problems. Having a single way to solve every problem will only ever get you to mediocrity. TIMTOWDI and DWIM make it possible to express ideas in new and interesting ways.

The "one, true way" approach of Python and Go seem to make it easier for AI to consume the entire programming field. Have you tried working in Perl with AI? Ha, good luck. The lack of actual comprehension becomes entirely obvious.

WIRED · Programmers Aren’t So Humble Anymore—Maybe Because Nobody Codes in PerlBy Samuel Arbesman
#Perl#Python#golang

Any former #CentOS #Linux users or maintainers aware of any projects providing security update repos for CentOS 6? Or know of a good upgrade/migration path from it to something else? I have a larger #Perl and #Apache mod_perl app that I need to lift and shift.

Every once in a while I'm just flabbergasted by how bad #Perl error-handling is, or at least old-style error-handling before Perl's version of exceptions started to catch on.
Like, the "messages" method of a "Mail::IMAPClient" object returns an empty list if there are no messages to fetch, but it returns undef (a scalar, not a list) if there was an error, so you can't just do "!@msgs" to check for an error, you have to do "@msgs==1&&!defined($msgs[0])". Ridiculous.
#programming

#Perl @PerlWChallenge 332 Task 2: Odd Letters
#noxp
```
perl -MList::Util=all -E '
for(@ARGV){my %c; $c{$_}++ for split ""; say "$_ -> ", (all{$_%2} values %c)?"T":"F"}
' weekly perl challenge
```

I've recently uploaded a new version of the #Perl #Catalyst plugin to #CPAN

Catalyst::Plugin::Static::File is an extension for serving a single file that plays nicely with #Plack especially Plack::Middleware::XSendFile and Plack::Middleware::ETag.

metacpan.org/release/RRWO/Cata

The new version has minor code changes but requires a more recent version of Catalyst. There's also a lot of reorganisation of the documentation.

MetaCPANCatalyst-Plugin-Static-File-v0.2.4Serve a specific static file

I didn't know anything about this! Cool 😍

"Before Larry Wall created Perl, he studied linguistics. Unlike other programming languages designed around a mathematical notion, Perl's design emulates how people communicate with people. This gives you the freedom to write programs depending on your current needs. You may write simple, straightforward code or combine many small pieces into larger programs. You may select from multiple design paradigms, and you may eschew or embrace advanced features.

Learning Perl is like learning any spoken language. You'll learn a few words, then string together sentences, and then enjoy simple conversations. Mastery comes from practice of both reading and writing code. You don't have to understand every detail of Perl to be productive, but the principles in this chapter are essential to your growth as a programmer."

https://www.modernperlbooks.com/books/modern_perl_2016/

#perl #larrywall #programming

www.modernperlbooks.comModern Perl: a Perl Tutorial 4e Table of Contents
Replied in thread

@domm: Oh fsck, #mst died? Very sad to hear. 😢 I still remember that he offered help and advise when I took over #Lintian, especially about the web backend (which the previous Lintian maintainer started to rewrite from scratch but never finished) where mst seems to have been involved from the #PostgreSQL side. He was also often present in #Debian's #Perl IRC channels and we chatted occasionally, not always about Perl. I think I also met him IRL once, but I'm no more sure where.

Oh my gosh, I didn't know that Matt Trout died. He was a definite "presence" in the Perl world.

The last time I interacted with him was years ago. He was trying to convince to me to get involved in taking on XS components of some CGI-related modules. I'd have rather had needles pounded into my eyes.

I always appreciated his bluntness. And his very fast, sharp intelligence.

I didn't even know he wasn't able to work much lately. Godspeed Matt.

#Perl #wetlands

shadowcat.co.uk/2025/07/09/rip

www.shadowcat.co.uk“Ripples They Cause in the World” – Shadowcat Systems Limited
Replied to Profoundly Nerdy

@profoundlynerdy That's a purely syntactic issue. You want (...) to be parsed as the (...)[...] list slice operator, but here say gobbles it up for the say(...) function call syntax. Two solutions:

  1. say((split " ", "Foo Bar")[0])
  2. say +(split " ", "Foo Bar")[0]

(I changed split / / (which splits on single spaces) to split " " (which splits on any kind of (repeated) whitespace) because that's usually what people want. If you need " Foo Bar" to become ("", "Foo", "", "Bar"), use split / /.)

Solution #1 simply nests the syntactic structures: You have a list slice (...)[...] inside a function call say(...). Solution #2 (ab)uses the unary + operator, which is a no-op, but syntactically separates say from (, thus preventing ( from being parsed as the start of an argument list.

But if you only want to extract the first "word" (chunk of non-whitespace) from a string, you could also use say "Foo Bar" =~ /(\S+)/.

Dumb Perl question, because I'm insufficiently caffeinated, the answer isn't coming to me and my DDG-fu is failing me. Given the Perl one-liner that prints "Foo":

```
perl -E 'my @a = (split / /, "Foo Bar"); say $a[0]'
# Foo
```

How do I rewrite it so that an intermediate variable is not required? Doing `say ( ... )[0]` won't work, because `()` controls precedence, it doesn't construct an array. Can't seem to make it work I'm annoyed. 🤦