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)
Matt Doyle | Elated Communications
Web and WordPress Development
Learn the Perl programming language and discover how to write CGI scripts such as form mailers, guestbooks and dynamic content scripts.
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:
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.
Perl’s filesystem functions let you manipulate files and directories on the server from within your CGI scripts. This means that you can:
…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!
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!
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.
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.
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!
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.
Copyright © 1996-2024 Elated Communications. All rights reserved.
Affiliate Disclaimer | Privacy Policy | Terms of Use | Service T&C | Credits