Perl Weekly Challenge 109: Chowla Numbers and Four Square Puzzle
These are some answers to the Week 109 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few days (April 25, 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: Chowla Numbers
Write a script to generate first 20 Chowla Numbers, named after, Sarvadaman D. S. Chowla, a London born Indian American mathematician. It is defined as:
C(n) = sum of divisors of n except 1 and n
Output:
0, 0, 0, 2, 0, 5, 0, 6, 3, 7, 0, 15, 0, 9, 8, 14, 0, 20, 0, 21
Originally, the task requested us to generate the first 37 Chowla numbers and I wrote implementations in 12 different languages based on that requirement. This requirement has now been amended to the first 20 Chowla numbers. I’ll fix the program and output for some implementations, but will leave some as they were developed.
Chowla Numbers in Raku
From the user perspective, Perl strings have no bugs and work well.
I feel that in the upcoming version of Perl, the core team fixes the Unicode bug as a reason to break backward compatibility Perl 5.
Unicode in Perl internally has some inconsistencies due to conflicts between latin-1 and UTF-8.
this is true.
On the other hand, from the user's point of view, a Perl string works perfectly fine if you only accept it can't tell whether it's a decoded string or a bytes.
We are solving this problem by convention.
Where do we determine if it is a string or a bytes?
The inside and outside of the program are completely separate.
If the data comes in from outside, then we will determine if it is a bytes or a string.
If it is a bytes, do nothing.
If it is a string, decode it.
This is simple and all of all works well.
In fact, this way is a good one.
Inside the program, we don't need to worry about the character code.
Perl 7: A Risk-Benefit Analysis
At the recent Conference in the Cloud for Perl and Raku, Sawyer X (the pumpking of Perl) announced an ambitious plan for Perl 7. Since Perl 6 was renamed to Raku to better communicate its fundamental differences from the well known identity of Perl, major versions are now available again for Perl to leverage, and it is a very important step to show that the language is still developed and used. I completely agree with the motivation and ideals presented, and have thought a lot about the benefits and risks involved in such ideas long before I was aware of this project.
Perl Weekly Challenge 66: Divide Integers and Power Integers
These are some answers to the Week 66 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Task 1: Divide Integers
You are given two integers $M and $N.
Write a script to divide the given two integers i.e. $M / $N without using multiplication, division and mod operator and return the floor of the result of the division.
Example 1:
Input: $M = 5, $N = 2
Output: 2
Example 2:
Input: $M = -5, $N = 2
Output: -3
Example 3:
Input: $M = -5, $N = -2
Output: 2
Please not yet-another-oo-system, let's support frameworks
I'm very keen to be actively deprecating and removing syntactic oddities that folks should already be prohibiting via good perlcritic policies (i.e linting) hopefully in their editors and CI pipelines.
And standard perl is a good way for code bases to prepare for the future and derive real benefits right now. Both build on the meritocracy approach of CPAN.
It is that meritocracy that brought us the object frameworks Moose (which people seemed to feel was too big) and then Moo+Type::Tiny (which people seem to feel is about right). There are many other frameworks (object systems) which perl's minimalist internal object functions enable people to write, if one of them strikes a better balance of trade off's then there is nothing to stop it supplanting Moo as number one.
Perl 7 Thoughts
Overall, I think the Perl 7 announcement is great news.
I only have one small objection:
Perl Weekly Challenge 108: Locate Memory and Bell Numbers
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
Perl 7, not quite getting better yet
Hegel remarks somewhere that all great world-historic facts and personages appear, so to speak, twice. He forgot to add: the first time as tragedy, the second time as farce.
The Eighteenth Brumaire of Louis Napoleon - Karl Marx
Sawyer just announced his plans for perl 7. And while Perl 7 sounds like a lovely language, I do see a number of issues:
Cohabitation / Forking
The proposal is presented as a linear progress, I don't believe this is realistic. This would be fork much like the python 3 transition is (which also wanted to be a simple linear progression). As we all know, they're currently in year 12 of a 5 year transition.
There are several problems here. CPAN as an ecosystem is the one that is given most attention to (not without reason; it is without doubt the most important collection of Perl code), but it's not even the biggest problem.
CY's take on PWC#065
Good morning from the Asian timezone.
This is a part of Perl Weekly Challenge(PWC) and the followings are related to my solutions. If you want to challenge yourself on Perl, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email)(before Monday GMT+0 00:00) if possible, before reading my blog post.
🤔
Perl Weekly Challenge 107: Self-Descripting Numbers and List Methods
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.
Self-Descriptive Numbers
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:
The Secret XS Diaries
I just rediscovered an old project of myself when I was learning Perl/XS and wanted to drop a hint to it here.
It might be useful for others who also have no idea how XS works and who would benefit from the approach and point of view of another XS newbie.
It is both the step-by-step description and a CPAN-ready Perl distribution.
You can find it on github:
Acme::The::Secret::XS::Diaries
Happy hacking.
Cannot change password
Wouldn't it be nice to be able to change my (hacked) password for blogs.perl.org?
Unfortunately, the password change form complains that it couldn't verify my current password, which doesn't come as a surprise as there is no field on the form to enter it.
Contacting author of Net::Azure::StorageClient
I am trying to contact Junnama Noda author of Net::Azure::StorageClient
I have sent two emails now to the public email address listed in his public github profile and have received no bounce or response.
If anyone is in contact with him, please have him contact me
Dean
Perl Weekly Challenge 106: Maximum Gap and Decimal String
These are some answers to the Week 106 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a couple of days (April 4, 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: Maximum Gap
You are given an array of integers @N.
Write a script to display the maximum difference between two successive elements once the array is sorted.
If the array contains only 1 element then display 0.
Example:
Monthly Report - June

COVID-19 seems to be still haunting us but life is getting back to normal slowly. I had the pleasure to attend the first "Conference in the Cloud". It was 3 days event. I booked 3 days off from the work so that I can focus on the event without any interruptions. It was my first experience attending event in the cloud. I found it hard to focus on the talk in general.
Could it be as I was at home with kids running around?
The day one itself started on a very happy note with the announcement of "Perl 7" by Sawyer X. The entire day one was dedicated to this very topic. brian d foy even had his first book "Preparing for Perl 7" launched with the announcement. Thanks to the author brian d foy, I had the pleasure to read the first copy of the book. I simply loved it. The best introductory book on Perl 7 so far. Please go and check out yourself.
Thinking and Question of The Proposal for Perl 7 - day1
I write my thinking and question about Proposal for Perl 7.
1. MAJOR version when you make incompatible API changes,
First of all, I am wondering about this assumption.
This is because there are very few incompatible API changes in Perl's history (Perl 1, 2, 3, 4, 5).
If the Python developers are thinking this way, it makes sense.
Has Perl ever thought of this in history?
Perhaps Perl has kept the maximum backward compatibility even in the major version upgrade?
The fact about Perl (rather than theory or ideal) is that Perl has kept its backward compatibility so that it can execute the assets of older programs.
Perl has taken care of old users who use Perl for a long time and cannot easily change their habits.
I believe this is Perl's kindness.
Perl is a language that emphasizes facts, reality and work, practicality.
Perl 5 has been very successful because it keeps backword compatibility with Perl 4.
I believe that this idea will be very successful even when upgrading from Perl 5 to Perl 7.
Because it really succeeded.
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.



