You’ve done your research, you’ve picked a good hosting plan, and you’ve signed up. What’s the next step? You’ll need to orient yourself to the contents of your Web space, and learn how to upload Web pages. This tutorial shows you how.
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:
- Arrays (lists)
- Associative arrays (hashes)
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:
- 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!
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.