Home About Subjects

McGresty and Perl

Twenty two years ago I became a graphic designer which involved branding some major stuff. A few years after that I also began to develop websites for various clients scattered around the world. One client for whom I did his branding also wanted a database and the cheapest offer was 50,000 UKP. He didn't even earn that much a year, so I built one for him at a much lower price. For that I had to learn to program and decided to use a lanaguage named Perl. It was difficult for me, but a fellow named Graham gave me a lot of help. After retiring in 2010, I wrote some blog software and decided a year later to become a travel blogger.

Perl blog engine

Some people have asked what I use for my blog, I wrote my own package because I did not like WordPress written in PHP. This is a short overview. The concept could be applied to other programming languages besides Perl (not PHP)—it's very simple.

A main Flat-file database record:
20161121214218|The post title|CAT|cc|
The break down
  1. 20161121214218 (The ID)
      2016—year
      11—month
      21—day
      21—hour
      42—minute
      18—second
    From this various date formats can be coded in.
  2. The post title—The title of the post.
  3. CAT—the category.
  4. cc—when comments for that post are closed.
mgap1.gif
The ID field points to the text file with all content of the blog post (20161121214218.txt) and it's comments file (20161121214218-c.txt), which is a flat-file database (FFDB) for all the comments, saves server space. A thing named a Query String (and its Parser) is used to denote that entry to the blog. The Category field pulls in another FFDB for it's info and also a file with a list of links within that category. So it is relational, but in a very small form, extremely fast and does not use MYSQL.

The result is a blog engine/CMS which can have site pages in addition to blog pages, mail outs for comments, different homepage settings and a bunch more. All in a base install of 115k—as opposed to megabytes! Editing is handled by an HTML markdown editor so that there is consistency across browsers and is there to manage the contents only—not to build a website.

Imagery

Blog articles are a combination of words and images. The images are there to support the writing, not the other way around. They must load fast and be as clear as possible, which can be a problem depending on what type of image it is. JPEG (.jpg) can lose clarity but load fast and should be small. Some sites I've seen have massive photos of 2-5 megabytes and to compensate for the size shown involves resizing, which slows the page loading down. Mine are shown in their actual size (535 x 403) and load very fast. The above image is actually a .gif file and small 14.8 KB.

Yes there is the Jpeg loss, but the image is not what an article is about. They are there to be part of something larger and I certainly do not want to spend huge amounts of time messing about converting to WEBP, I have better things to do. Everything on a post is driven by Perl, which is much safer than PHP driven websites, residing in the public area of a host (requiring massive protection). There is also Python and Ruby which reside in a lower and more safer part of a server, where Perl is as well. At the time of writing this there a serious global problem with PHP. Many thousands of major and minor websites are closed down, glad I don't use WordPress.

I am now in my 16th year as a travel blogger and still enjoying it.



Does the job for me.
 
Nov 20, 2026

Make comment