Perl Programming

Perl Programming – Bubble Sort a String

After getting familiar with the syntax of a language, performing little challenges – such as sorting a list of items – is often the next thing one might try. So, although I’d previously lots of Perl experience, having focused on other things for a while I was decidedly rusty, and decided to reactivate my Perl braincells, and write a little program to bubble sort a string in Perl. 

Continue reading »
Perl Programming

Perl – One-liner to Get Local IP Address, No Modules

The code in this post will enable you to identify your system’s local IP address and put it into a variable for your further use. I specifically did this to identify the IP address on a Ubuntu WSL2 instance (i.e. Windows Subsystem for Linux), but it should work on any machine. As anyone familiar with WSL2 will know, unlike prior versions of WSL, WSL2 doesn’t keep a static IP address, which can be a pain, and provides a new one on each startup. So, being able to identify the newly allocated IP at startup can be quite handy.

Continue reading »