Programming


Compile Perl Script Using PAR

Compile Perl Script Using PAR

PAR allows you to make your Perl scripts portable. It will allow them to bundle with the interpreter, any DLLs, and all modules required to simply pass around your exe. How to Install PAR This is tested on Strawberry Perl, Windows 10. YMMV. Installing PAR will require a few other modules first. Please ...

Count Lines in CSV Using Perl

Count Lines in CSV Using Perl

We have hundreds of CSV files, and need to know how many lines are in each one. A simple way to count lines in a CSV file is to open it, update your line count, then close it. CSV Output Count Example Counted Lines in CSV files Shell Counting lines in files combined1.csv,13875256 combined2.csv,1234 combined3.csv,144 combined4.csv,13801 DONE!! 3 wallclock secs ( ...

Reorder Text With Perl Split and Splice

Reorder Text With Perl Split and Splice

We were hired to edit some transcriptions. The transcriptions were in different formats. Sometimes the “time” was first, and sometimes the “who” was first. Here is one way to reorder text programatically. Original Text to Reorder The client gave us text in the format of “who”,”when”,”what was said” Shell Female: '00.0s' "Hello!" Male: ...

Check Perl Module Versions

Check Perl Module Versions

It will often arise that you are having a problem with a script that you know should be working. One way to troubleshoot why it’s not working is to compare versions. There are many ways to check versions, some simpler than others. Here are a few that we use: Check Perl Module Version with CPAN This ...

Check Supported Encoding Types Using Perl

Check Supported Encoding Types Using Perl

When working with ascii files, csv and other text format files you will often need to know the encoding that your system supports and the encoding of the file you are working with. You can guess, or you can just ask the OS. Here is what my system supports natively Sample Encoding List ascii ascii-ctrl cp1252 iso-8859-1 null utf-8-strict utf8 Perl Script to ...

Annuvin Game Board from Perl SVG

Annuvin Game Board from Perl SVG

Annuvin is a game that solves the issue of unbalanced play. As you progress through the game, the losing player actually gets stronger. Objective of Annuvin Eliminate all opposing pieces by replacement. Annuvin Setup Each player has 7 tokens, placed opposite each other, as per the diagram. It is played on a 4 ...

Agnon Board Game in Perl SVG

Agnon Board Game in Perl SVG

Calculating hexagons is fun, right? Well, hand drawing them is no fun. There are several fun games based on hexagon boards and we wanted to make them on the CNC router. Here is the Agnon game board and rules, as well as the Perl script that created it for our ...

Windows SAPI Using Visual Basic

Windows SAPI Using Visual Basic

I’m not a fan of visual basic in general, but there are a few pretty cool things you can do with visual basic. One of them is “speak through your computer” using a script. This small visual basic script will allow you to type out anything you want spoken. If you prefer a ...

Screen Saver Quotes With Perl GD

Screen Saver Quotes With Perl GD

If you’ve ever wanted a screen saver with motivational quotes, but didn’t know how to make one – here is a Perl script to do it for you. I wanted to see how the GD module worked. So we created a small script to generate a bunch of JPGs. The ...

Add HTML to List Using Perl

Add HTML to List Using Perl

As we write articles we create lists and then add HTML. Adding HTML by hand is boring. Adding HTML with a GUI editor often leaves all kinds of junk in your HTML code. If you want to wrap simple list item tags around a text list, Perl can do ...