Crosis has asked for the wisdom of the Perl Monks concerning the following question:

Back in 2018 I came here as someone primarily using Python wondering about how things were going with Perl at the time. I got a lot of really great feedback and I have to say this community seems pretty excellent from what I've seen.

Now it's 2020 and I'm doing fairly hard algorithm stuff in Ruby and (as before) in Python, from LeetCode and various textbooks. I want something for my programming "downtime" that's just kind of experimental, for fun, not, like, writing CSP solvers and the like and trying to wrap my brain around all of that. I did actually use Perl extensively like 10 or more years ago when I was in my late teens and early 20s but obviously things have changed since then, or even since two years ago, so I'd like to hear about what people are doing these days, about their favorite modules, etc. and about interoperability between Raku and Perl 5 because the Raku ecosystem proper is still pretty small AFAICT. Are there any snags? It looks pretty straightforward but I haven't used any of it yet.

Perhaps more specifically, I'm looking for common utility stuff that is applicable in a broad array of settings. Analogies would be things like itertools and functools in Python, Lodash for anyone familiar with JavaScript, or the rather impressive Enumerable module in vanilla Ruby that does quite a few things most language standards don't.

  • Comment on What are people doing with Perl 5 and Raku these days?

Replies are listed 'Best First'.
Re: What are people doing with Perl 5 and Raku these days?
by GrandFather (Saint) on Nov 03, 2020 at 23:32 UTC

    In the past I've used Perl for writing web sites (Duh!) and a major software build system used by our company. Nowadays I use Perl almost exclusively for writing one off utilities. For example a few times I've used Perl scripts to take the contents of a table in documentation for a standard like IEE-1588 and used it to generate hundreds of lines of C++ code for an embedded system. A few dozen lines of Perl can save hours of tedious work and even more hours of hair pulling frustration finding typos with debugging ICE!

    I also frequently use Perl to parse results from tools like logic analyzers to find interesting events or calculate parameters that can't be derived directly from the tool's output. I use Perl in that sort of role most days.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

      Was this with CGI or a modern framework or both? CGI still exists but I don't think people are writing much new with it. I know there is Perl and Raku code more or less like Rails etc. and I'd like to hear about that too.

        The web stuff was CGI, but at least 10 years ago so there was a slight excuse.

        Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re: What are people doing with Perl 5 and Raku these days?
by alexander_lunev (Pilgrim) on Nov 04, 2020 at 08:50 UTC
    I'm using Perl (with Mojolicious) for backend in various applications, I posted something about it in Re^3: Constructive thoughts on Dancer2 v Mojolicious. Also, i'm using Perl to make various small utilities, when you need process a lot of data, getting it from text/csv/sql and putting result to text/csv/sql. I don't see anything near as simple and powerful as Perl for those tasks.

      In fairness, Pandas (Python) is very powerful for that sort of thing. It would appear that Perl implements some of that functionality in PDL however.

        Oh, I don't do nothing THAT complex to use SUCH powerful things ;)

        Language level of Python and Perl are the same for me: speed, features, what can be done with them. But Perl have curly brackets for blocks, and Python don't, so programming in Python is always an indendation pain for me (sometimes I need to do something with Python, and it's frustrating), while programming in Perl is always fun. And now when I learn how to make Mojolicious application a Windows service (with Mojo::Server::Elzar), I'm loving Perl more than ever.

Re: What are people doing with Perl 5 and Raku these days?
by marto (Cardinal) on Nov 04, 2020 at 20:45 UTC

    I do a lot of work professionally and currently some (due to time constraints) personally with perl, these days much of this uses the Mojolicious framework. It makes building web based systems fun again and is a joy to work with. Recently I put together a application in Mojo that can replace two existing systems (one our old perl CGI::Application based tool and the other a proprietary mess with vast hardware and software dependencies, impacting both server and client side.). The little Mojo app is many times faster than the production system, and does things it never could. Mojo also provides a great deal of other things to the table including Mojo::DOM and Mojo::UserAgent which making parsing/scraping, munging and manipulating any web based contents fairly trivial. The framework and tools provided are well worth exploring.

Re: What are people doing with Perl 5 and Raku these days?
by perlfan (Vicar) on Nov 05, 2020 at 02:39 UTC
    Raku might provide a nice environment for programming language research given it's first class treatment of grammars. You may like a couple of recent talks:

    Perl 5 is suitable for any kind of research and tinkering once it gets out of your way, seems based on your intro that you could achieve this state quickly so that you're able to focus on the problems to solve rather than fighting the language. Also, PDL is still alive and kicking.

    I don't know much about tools from other languages, but I've always found Perl native data structures to naturally work very will with any kind of nested or linked data structures like trees and graphs. Same applies for text analysis via feature extractions. This strength doesn't extend to image based machine learning because it is currently lacking complete wrapper modules around things like OpenCV. Another area that has really been strong recently is it's foreign function interfacing (alternatives to XS for "simple" things) for shared libraries and inlining other languages.

      I think generally speaking, Perl, Ruby, Python ... Smalltalk, whathaveyou, with any decent set of default collections will be able to do trees and graphs pretty easily. I like having regexes as part of syntax (which Ruby and, surprisingly, JavaScript also does) and I'm not aware of any other language that has first-class grammars other than Perl 6 / Raku.