Category: Programming
-
Improvements to Planet Perl and Perlanet
This is a story of one of those nice incidents where something starts off simple, then spirals out of control for a while but, in the end, everyone wins. On Reddit, a few days ago, someone asked ‘Is there a “Planet Perl” with an RSS feed?’ and a few people replied, pointing out the existence…
-
Writing a CPAN module that talks to ChatGPT
ChatGPT exposes an API, but there’s no CPAN module for taking advantage of that. Let’s put that right (with help from ChatGPT)… Write a Perl CPAN module for connecting to a ChatGPT server To create a Perl CPAN module for connecting to a ChatGPT server, you will need to have Perl and the necessary dependencies…
-
Counting Weekends and Wrapping Text
I said that I probably wouldn’t have time to get involved with the Perl Weekly Challenge every week and that has, unfortunately, proven to be the case. But I had a few free minutes earlier in the week so I decided to look at this week’s challenges. I’m glad I did because they seemed to…
-
Perl Weekly Challenge – 2019-03-25
I’m not sure that I’ll have time to do these every week, but here are my answers to this week’s two Perl Weekly Challenges. Challenge #1 Write a script to replace the character ‘e’ with ‘E’ in the string ‘Perl Weekly Challenge’. Also print the number of times the character ‘e’ found in the string. use strict; use warnings; use feature ‘say’;…
-
A Subtle Bug
Earlier this week, I saw this code being recommended on Stack Overflow. The code contains a nasty, but rather subtle bug. The version I saw has been fixed now, but I thought there were some interesting lessons to learn by looking at the problems in some detail. Let’s start by working out what the bug…