• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Matt Doyle | Elated Communications

Web and WordPress Development

  • About Me
  • Blog
    • Design & Multimedia
      • Photoshop
      • Paint Shop Pro
      • Video & Audio
    • Online Marketing
      • E-Commerce
      • Social Media
    • Running a Website
      • WordPress
      • Apache
      • UNIX and Linux
      • Using FTP
    • Web Development
      • HTML
      • CSS
      • JavaScript
      • PHP
      • Perl and CGI Scripting
  • Portfolio
  • Contact Me
  • Hire Me
Home / Blog / Web Development / Perl and CGI Scripting

Perl and CGI Scripting

Learn the Perl programming language and discover how to write CGI scripts such as form mailers, guestbooks and dynamic content scripts.

Data Types in Perl

3 September 2005 / Leave a Comment

Like most programming languages, Perl knows about different varieties of data. In this tutorial we’ll explore the most common data types used in Perl:

  • Scalars
  • Arrays (lists)
  • Associative arrays (hashes)

[Read more…] about Data Types in Perl

Controlling Program Flow

27 January 2005 / Leave a Comment

Normally when you run a Perl script, the computer moves through each line of your script in turn, executing each line as it goes. However, often you’ll want to alter this flow through the script.

For example, you might want to run different pieces of code depending on whether a visitor has filled out a form correctly or not. Also, you often want to run the same piece of code lots of times – for example, when reading through each line of a file.

Perl features a number of useful ways to alter the path of execution through your script. In this tutorial I’ll show you the most common techniques, and how you can use them.

[Read more…] about Controlling Program Flow

Working with Files

7 July 2003 / 3 Comments

Perl’s filesystem functions let you manipulate files and directories on the server from within your CGI scripts. This means that you can:

  • store data in files on the server
  • allow visitors to upload files to your site
  • create message boards and guestbooks

…and all sorts of other useful stuff!

In this tutorial, we’ll show you how to create files and write to them, how to read from them, how to delete them, and how to scan directories (folders) so that you can see what files are on the server.

We’ll also discuss file and directory permissions, and the concept of full paths. At the end of the tutorial you’ll find a useful script to help you work out your full paths (essential for working with files).

This tutorial will also touch on some other Perl concepts such as while loops, lists, and appending strings to variables. It’s quite a long tutorial, but worth sticking with. By the end of it you’ll have learnt a lot of useful concepts, and you’ll be able to write your own CGI scripts to read and write files on your server!

[Read more…] about Working with Files

Form Validation with Perl and CGI

12 June 2003 / 13 Comments

In this tutorial we’re going to write a CGI script that checks whether a form has been filled out correctly. Along the way, you’ll also learn about the concepts of reentrant forms and Perl subroutines. Read on!

[Read more…] about Form Validation with Perl and CGI

Troubleshooting CGI Scripts

14 May 2003 / 2 Comments

If you’ve tried running a few CGI scripts on your Web server, you’ve probably come across a few problems now and again. Usually, when your script has a problem, you will see an error message similar to the following in your Web browser:


Internal server Error

The server encountered an internal error
and was unable to complete your request.

It’s not a very helpful message, is it! Fortunately there are ways to find out the exact cause of your script error. In this tutorial we look at methods that you can use to troubleshoot your scripts, and also list some common causes of CGI errors.

[Read more…] about Troubleshooting CGI Scripts

Writing a Simple Form Mailer

11 March 2003 / 21 Comments

In this tutorial I’ll show you how to create a simple form mailer CGI script in Perl. A form mailer script allows you to add feedback forms to your site. Visitors fill in the forms, and the information they fill in is emailed to you.

[Read more…] about Writing a Simple Form Mailer

Your First CGI Script

3 March 2003 / Leave a Comment

In this tutorial I’m going to show you how to write a very simple CGI script. I’ll also show you how to upload the script to your server, and get the script running.

Once you’ve mastered the technique of uploading this CGI script, you can use the same technique to install other CGI scripts too!

[Read more…] about Your First CGI Script

Introduction to Perl and the CGI

13 February 2003 / Leave a Comment

You’ve probably heard of CGI scripts. They’re what you often see after you’ve filled in a Web form (e.g. “Thank you for contacting us!”), or when you use a guestbook or a bulletin board.

[Read more…] about Introduction to Perl and the CGI

Primary Sidebar

Hire Matt!

Matt Doyle headshot

Need a little help with your website? I have over 20 years of web development experience under my belt. Let’s chat!

Matt Doyle - Codeable Expert Certificate

Hire Me Today

Call Me: +61 2 8006 0622

Stay in Touch!

Subscribe to get a quick email whenever I add new articles, free goodies, or special offers. I won’t spam you.

Subscribe

Recent Posts

  • Make a Rotatable 3D Product Boxshot with Three.js
  • Speed Up Your WordPress Website: 11 Simple Steps to a Faster Site
  • Reboot!
  • Wordfence Tutorial: How to Keep Your WordPress Site Safe from Hackers
  • How to Make Awesome-Looking Images for Your Website

Footer

Contact Matt

  • Email Me
  • Call Me: +61 2 8006 0622

Follow Matt

  • E-mail
  • Facebook
  • GitHub
  • LinkedIn
  • Twitter

Copyright © 1996-2023 Elated Communications. All rights reserved.
Affiliate Disclaimer | Privacy Policy | Terms of Use | Service T&C | Credits