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 that for you.

This is a rather mundane use case for Tk and Perl, but the concept could be applied to all sorts of CLI activities too. Basically you are looping over each line and adding something to the front and the back of that line.

We share this as a demo of how to create a Perl Text Processor in Tk. Tk itself is rather venerable, but it works!

Topics to Learn:

Look at the image, it shows this exact list and that is because we used the program to make the HTML for this article.

  • Tk Framings Pack
  • OS Detection
  • Hide TK Console
  • Constants
  • Create Buttons in Tk
  • Delete Textarea in Tk
  • Simple Regex
  • Perl Subroutines
  • Perl for loops

Perl Source Code to Wrap Front and Back of Each Line with HTML

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.