Spoiler Alert: This weekly challenge deadline is due in a few days from now (on November, 20, 2022 at 23:59). 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: Twice Largest
You are given list of integers, @list.
Write a script to find out whether the largest item in the list is at least twice as large as each of the other items.
In 2022, the German Perl/Raku Workshop will take place in Leipzig. We are very happy to announce that long time Perl supporter Geizhals Preisvergleich sponsor the workshop.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on November, 13, 2022 at 23:59). 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: Capital Detection
You are given a string with alphabetic characters only: A..Z and a..z.
Write a script to find out if the usage of Capital is appropriate if it satisfies at least one of the following rules:
1) Only first letter is capital and all others are small.
2) Every letter is small.
3) Every letter is capital.
A casual remark about closures which I made in My Favorite Warnings: redefine touched off a long off-topic exchange with Aristotle that I thought ought to be promoted to a top-level blog entry. The big thing I learned was that any Perl subroutine can be a closure. The rest of this blog will try to make clear why I now believe this. The words are my own, as are any errors or misconceptions.
The second sentence of Wikipedia's definition of a closure says "Operationally, a closure is a record storing a function together with an environment." This makes it sound a lot like an object, and therefore of little additional interest in an O-O environment.
This blog post addresses checksum and signature verification vulnerabilities affecting CPAN, the cpan client, and the cpanm client, which were published in a security advisory on 23rd November 2021. If you're not aware of this topic, you might like to start by reading the advisory. This post gives a high-level description of the issues, what has been done to address them, what is still left to do, and what you should do. If you have any questions on this, you can add comments here, or email the PAUSE admins (modules at perl dot org).
Before we dig into the details, we'll first give an overview of how the relevant parts of the CPAN ecosystem work.
If you're not interested in the details, skip to the section "What do you need to do?"
TL;DR: make sure your CPAN client uses https and a trusted mirror – such as cpan.org
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on November, 6, 2022 at 23:59). 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: Greater Character
You are given an array of characters (a..z) and a target character.
Write a script to find out the smallest character in the given array lexicographically greater than the target character.
Example 1
Input: @array = qw/e m u g/, $target = 'b'
Output: e
Example 2
Input: @array = qw/d c e f/, $target = 'a'
Output: c
The deprecated warning is a grab-bag. Basically, anything that is deprecated causes this warning to be generated, and the list changes from release to release.
The only reason I can think of ever to turn this off is around a deprecated construction while you are actively working to eliminate it. Silencing it and then forgetting about it will bite you, eventually.
For the curious (and to run my word count, since otherwise this would be a really short blog entry), the current list of deprecations according to the 5.34.0 perldiag is:
David was a gentleman and a scholar: a gentle, warm, erudite, funny, clever, and deeply kind man. And one who has made a vast contribution to our Perl and Raku communities over more than quarter of a century.
My most sincere condolences to David's family...and to the countless other colleagues, acquaintances, and admirers around the world who will be mourning him today.
Like so many others, I was proud to call David my friend.
I will miss him profoundly.
I registered on blogs.perl.org today so that I could comment on posts about object systems. However, the very first thing I encountered was a password page with NO SSL. So, even though I have a ton to say about object systems, my first blog post will instead be about setting up SSL.
(I’m aware that this is a “legacy server problem” but I also recently learned that it doesn’t matter with traefik.)
In this grand year of 2021 you can add SSL to any site, on any architecture, for free, by adding 3 files to your server, making one small config change to Apache, and running a service. We are truly living in the future.
Perl Zemi is Japanese Perl Tutorial site which is well known and red in Japan. Most of all Japanese Perl users know Perl Zemi and read the document repeatedly.
The volume of content is large and has a reputation for being easy to understand.
This site is originally Japanese. I started to translate this site into English at 2021-11 using an automatically translation tool. I plan that the not very good descriptions and examples by the automatic translation will be gradually fixed until 2023-01.
[Author’s note: If you’ve read Curtis Poe’s most recent blog post, what follows is going
to seem eerily familiar. This post uses the same concepts, arguments, and code examples as his, and
reaches exactly the same conclusions. That’s because both posts originate from a long
and wide-ranging email discussion between Curtis and myself, as I’ve been privately
consulting with him over the past few months on the design of Corinna.
When I read Curtis’s post I almost decided to bin this one, as he managed to cover everything
necessary in his usual succinct, eloquent, and engaging style. But he has encouraged me to post
my version of this discussion too, as it provides a little more detail on some of the issues
we’re addressing, and on the design rationale for the changes we are jointly proposing.
Two friends, Foo and Bar gone on holidays separately to the same city. You are given their schedule i.e. start date and end date.
To keep the task simple, the date is in the form DD-MM and all dates belong to the same calendar year i.e. between 01-01 and 31-12. Also the year is non-leap year and both dates are inclusive.
Write a script to find out for the given schedule, how many days they spent together in the city, if at all.
Example 1
Input: Foo => SD: '12-01' ED: '20-01'
Bar => SD: '15-01' ED: '18-01'
Output: 4 days
Why ? Because I can. More seriously I have a project where I need to inject new Snes code in a running game and I want to express directly this new code in my Raku component (A webserver service). I want to have special sub that returns me Snes bytecode but that contains Snes assembler.
I tried injecting a SLANG in Raku already. Like writing my $byte-code = SNES lda $42; sta $54; rtl; But it’s rather tricky and I will probably just have a additional Slang with its own grammar in a dedicated file.
I created a very basic calculator using wxGlade and the Wx Perl module on CPAN.
This is a short one. I've been playing around with wxGlade because it generates Perl code. It is pretty easy to get started on Ubuntu using the base perl.
sudo apt-get install wxGlade
sudo apt-get install libwx-perl
It took me a while to get the feel of wxGlade, so hang in there. The pay off is when you figure out how to:
build a basic GUI using the builder tools
generate Perl code to just show the GUI (with no actions)
inspect the Perl code
run Perl code
start defining the event handlers
It also takes some time to get an idea about how the Perl code via wxGlade gets injected into the Perl file. I recommend experimenting with the different places in wxGlade you can put in code.