Let's examine if in 2021 an email redistribution list, i.e. perl5-porters@ (p5p) is still the best model for collaborating on the perl language. This is a discussion so comment below!
Advantages of an email list:
- Familiar interface, people can use their client of choice
- Low resources to run and maintain
- Easy to derive automation from as email is all well known protocols
- Everything is email
Disadvantages of an email list:
- Email addresses disclosed to all participants (can be changed)
- UI experience for participants inconsistent, may require client side configuration to "get right"
- Email "reply" text can lower the signal to noise ratio
- No topic categorization of posts, its all dumped in to your inbox
- Tricky to respond to missed emails
- Moderation is crude, every email is reviewed and approved, or everything is approved
- Once an email is relayed it can't be moderated further
- Encourages side channel correspondence
- Everything is email
Given the long list of disadvantages we can guess why email lists (and newsgroups) have largely fallen by the wayside.
These are some answers to the Week 108 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few days (April 18, 2021). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Task 1: Locate Memory
Write a script to declare a variable or constant and print it’s location in the memory.
Locate Memory in Raku
Presently I have great interest in “EVs” Electric Vehicles but I haven’t seen any data on how much it would cost to charge an electric vehicle from 0 % to 100 % battery charge at home in NYC ( So I wrote a Perl script to do just that ) but before we dig in into it I explain a few things about Electric Vehicles.
Electric Vehicles will have a battery capacity that is represented by kilowatt-hour units or kWh for short.
An EV’s driving range is represented in miles units ( In the US ) and the average mileage is determined by the EPA battery range rating ( the bigger the battery capacity usually means the more driving range you will have in a car ) after conducting a few tests ( so in reality your mileage will vary ).
Celebration time ...
The month of March is very special to me. It was in this month 2 years ago, I started my dream project The Weekly Challenge (a.k.a. Perl Weekly Challenge).
As most of you are probably aware,
Kent Fredric sadly passed away earlier this year:
notice from his family, on Facebook.
Kent was a prolific contributor to CPAN and Perl.
He released more than 150 distributions of his own to CPAN,
but also helped countless other authors and distributions,
with bug reports, puil requests, and more.
When a CPAN author dies,
their indexing permissions are dropped from PAUSE,
and where they had the first-come permission,
that will be passed to the pseudo-user ADOPTME.
This flags the distribution as being available for adoption.
So as of now, all of Kent's distributions are available for adoption.
These are some answers to the Week 107 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a couple of days (April 11, 2021). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Write a script to display the first three self-descriptive numbers. As per Wikipedia, the definition of Self-descriptive Number is:
In mathematics, a self-descriptive number is an integer m that in a given base b is b digits long in which each digit d at position n (the most significant digit being at position 0 and the least significant at position b−1) counts how many instances of digit n are in m.
For example, 1210 is a four-digit self-descriptive number:
Many people already have codes like
and so on at the top of each script they write. For scripts which I don't intend to publish anywhere, I have a module (which I accidentally called Z not knowing there was already a module of the same name on CPAN), which switches on lots of things at once just by saying
The top bit goes like this:
If you want to challenge yourself on programming, especially on Perl and/or Raku, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email).
My coding momentum is a bit low.
Reflections on the codes I have written:
Task 1: Palindrome Number
TMTOWTDI. On this seemly and actually simple task, I chose to compare the digit one by one.
Task 2: Demo Stack
A bit smell of laziness. I did not provide functions when stack is empty and pop() or min() is called.
Task 1: Reverse Words
A lesson on extra-white space. Oppositely but as lack of caution as a sin, this morning (GMT+8) I found I have forgotten a newline for my code for #105 Task 1.
Task 2: Edit Distance
That was a standard computer science exercise. I was astounded by reading Mr Abigail's blog on the approach on saving memory space.
Task 1: Caesar Cipher
During the last years it became fashionable to rag on object oriented programming and a decade ago I would join the choir. Hack, when I started with Perl I despised the bloat and inefficiency of many corporate smelling *coughjava* systems and preached the light weight and foreward thinking way that real hackers travel. In this miniseries I want to write why I changed my tune [part one], the best way (IMO) to use OOP [part two] and why inheritance (incl. roles and templates) and delegation or not helpful features (in contrast to polymorphism) [part three]. Maybe there will be more about rating Perl OO features and modules.
If you’ve read Curtis “Ovid” Poe’s articles on the declarative framework for Tau Station Link and Link, you are undoubtedly aware of many of the benefits this style of programming can bring. It decouples the “what” from the “how”, encourages discrete functions and prevents the OO trap of “god objects”. The result is software that is easy to test, robust and very flexible. Inserting steps, reording steps etc… are done much easier and more clearly than trying to figure this out in 300 lines of imperative code with four to six level deep if-else chains with for loops mixed in for good fun. However, the framework is tightly coupled to the game in spots and has a few other issues that make it not ready for general use.
I've been asked by a couple of Perl groups to give a virtual presentation. Writing new material that would only have been shown once is a lot of work for a small reward.
But, I just happened to be cleaning out my virtual junk drawer, and stumbled across my "half my life with Perl" slide deck that I had presented at OSCON 2013. Most of the stuff is timeless, as it describes Perl's first 25 years, and my second 25 years and how I influenced Perl, and Perl influenced me, and how my company (Stonehenge) was changed by all of this, and in some ways even changed all of this as well.
Please tune in at 6pm Pacific Time (currently UTC-7) on Monday the 22nd to watch it live. I will try to read the comments quickly at the end of the show and answer any questions as well. The video will remain permanently on Youtube at the address below.
Live link: https://www.youtube.com/watch?v=8VMz7GINc2E
On behalf of the Dancer Core Team, version 0.301000 is now available. This is not the release we envisioned; it is missing some things we'd like to have finished, but it does have a couple of new things worth pointing out:
- A new keyword,
request_data, to get the entire deserialized body of the request
- A new Cookbook recipe for showing how to dynamically enable/disable modules and routes at runtime
- Numerous doc and bug fixes.
Check out the changelog for a complete list of changes.
The big thing worth pointing out is
App::Cmd, which is now not a requirement of Dancer2. A new version of
App::Cmd was released with a minimum version requirement of Perl 5.20. We aim to support Dancer2 back to Perl 5.10, which was no longer possible with the current
App::Cmd. We had several options to consider in moving forward, and the one we chose was this:
If you're using XS and C in your Perl module, you might have to worry about memory errors. There are tools like valgrind or memory sanitizer which you can use of course:
valgrind perl -I blib/lib -I blib/arch ./mytestscript
or if your problems are even more serious ones like segmentation fault errors you can run Perl under a debugger like gdb:
% run -I blib/lib -I blib/arch ./mytestscript
However, it might be worth noting some "easy" ways to catch memory errors which actually catch a lot of things.
The first thing is setting the variable to 0 after freeing:
result = 0;
This prevents you from using the variable again accidentally after freeing, although free (0) is actually not an error, so it doesn't prevent you freeing it twice.
Twenty years ago today I released my first CPAN module: Fork::Queue.
Then there was a group of people supervising module names, and they advised me to move it under the Proc namespace and so it became Proc::Queue.
A couple of weeks before, a bug on one of my scripts had fork-bombed a production box. I barely remember the details now... just that my manager had a serious conversation with me about the incident.
Anyway, that forced me to write the module.
Something I remember for sure is the proud I was of it. How I had been able to replace several Perl builtins playing with the CORE::GLOBAL namespace in a (IMO) clever way!
Folk's in the world of Perl have been making amazing efforts to blog more and even to produce video content. That's awesome! Keep it up!
Risking sounding like a mandatory training video from HR, I want to remind budding authors of some high level criteria you should review before completing a post:
- Does it welcome new people to Perl?
- Does it welcome people back to Perl?
- Does it lift, encourage and praise them?
- Is it respectful to people who's use case, experiences and journey with Perl is different to yours?
- Is it respectful of peoples lifestyle, politics, background, and differing lived experiences?
- Does it grow the Perl community and celebrate our diversity?
- Does it teach people something new about Perl?
The answer in all cases should be yes.
Here are some examples that aren't inspired by any specific post but are based on content or comments I have read.
Using system perl is stupid, it's not real perl
Back to school ...
Apology for the delay in monthly report, usually I get it released on first day of the month.
Last month was the shortest month of the year as you all know, so getting things done became relatively harder.
What is in store this time?
Well, there were two things that took away all the attentions.
500th edition of Perl Weekly newsletter
I have been a regular reader of the weekly newsletter for many years now. If you want regular dose of Perl news directly in your inbox every Monday then please do subscribe the newsletter. I joined the elite group of editors in May 2018, thanks to Gabor Szabo for giving me the opportunity. I had the honour to edit the 500th edition of the Perl Weekly newsletter. It feels nice and gives me sense of achievments.
Too fanboy/girl-ish, perhaps?
Yes, I'm well on-trend, by a couple of months.
As you see, lockdown has made a hot mess of my blogging schedule.
I count myself very fortunate that is the worst effect it's had on me, alongside the gaining of some mass.
WfH WARNING! Watch out for those caramel waffles!
A single Stroopwaffle has enough calories to feed a hungry village for a day and are not a sustainable treatment for anxiety.
Two kWh per packet, not a word of a lie.
Despite rt.cpan.org still displaying the sunset message, it is in fact not going away forever on the 1st of March, but will have an 'extended downtime' while it is moved elsewhere. In future it'd be nice if communications of such things, and even allowing others to have a say on the matter, could be handled better.
I started the Inline::F2003 project in 2017 because I have a strong interest in modern Fortran and Perl programming.
The project features the Perl module Inline::F2003. This module allows modern Fortran source to be inlined and called from a Perl program. The module compiles the Fortran source and builds an executable shared library that is loaded into the Perl system.
Inline::F2003 is usually invoked at compile-time. The source fragment below shows typical use of the module.
It's often (for work or for personal projects) that I need to create a real-time feature for a website. This can range from a simple notification whenever an event happens on the server of an existing website, to implementing a real-time multiplayer game or adding a feature inspired from social media websites.
Unfortunately the increase in complexity in code (Perl & JS) and architecture involved in setting up a reliable solution, very often made me forego the opportunity to use WebSockets for many of these projects, and instead resorted to http polling to keep the solution simple for the others to maintain.
So I started looking for a library with a client & server component, that would make life easier. The library would hopefully have to have the following features: