Helping ordinary people create extraordinary websites!

Cgi-perl Tutorials


CGI and Perl Tutorials are a great way to learn more coding strategies and principles of CGI and Perl. Below is our collection of articles and tutorials where you should be able to find the right CGI and Perl tutorial to suit your need.



Random subroutines in Perl
Nov 23rd by Tony Lawrence

I'll bet your first question might be "why on earth would I ever want to call subroutines randomly?". Admittedly, it isn't a need that comes up that often, but (for example) it's used right here on this very page that you are reading.
Log Script Use
Jul 25th by Will Bontrager

How many old, unused (or under-used) CGI scripts do you have lingering on your server, taking up space? You may not be as guilty of abandoning CGI software in lieu of newer versions as we are (we've been creating, and testing software on the same server for 8 years) but odds are you've got a few dusty, unused scripts...
Creating Perl Modules for Web Sites
Jul 19th by Tony Lawrence

When you are writing your own code, you are more apt to use someone else's module than write your own, unless your project gets fairly large and complex. Small scripting tasks just don't need the advantages modules offer.
Bit Vector, Using Perl Vec
Jul 19th by Tony Lawrence

A bit vector is just an array of bits; subsets of bits within the bytes have some meaning. That allows more compact storage for certain types of data. For example, if you only needed boolean on-off values, you can store eight values in one byte.
Build a Perl/CGI Voting System
Jul 5th by Allan Peda

Many Web-deployed applications are written within elaborate database-driven server-side development frameworks such as PHP and Java™ servlets, but for simple applications (for example, where the entire dataset fits comfortably within a Web server's RAM), data persistence can be easily accomplished using locked DBM files in...
Perl Range Operator
Jun 16th by Tony Lawrence

In a list context, this operator is easy to use and understand. It is much more confusing in a scalar context, and is often badly explained in books and webpages.
Creating Perl Modules for Websites
Jun 16th by Tony Lawrence

When you are writing your own code, you are more apt to use someone else's module than write your own, unless your project gets fairly large and complex. Small scripting tasks just don't need the advantages modules offer. However, there is a case where modules might make perfect sense: web server cgi scripts often repeat...
Perl binding, or vs. ||
Jun 16th by Tony Lawrence

Perl has "||" and "or". While "or" can't be used in bit operations, either one can be used in logical flow control - but there is an important difference between them.
Transferring Mail to a New Mail Server
May 3rd by Tony Lawrence

Sometimes we just have to move on. Your current mail server may just not be meeting your needs, so you've put up something new. But what about old mail? If your servers are identical (Sendmail to Sendmail, etc.) or use the same mailbox storage format, you may be able to just transfer files directly. If not, read on..
Goal Seeking Code
May 3rd by Tony Lawrence

This is an extremely unsophisticated program that demonstrates evolutionary DNA. You start by passing it a string:
Replacing a Spreadsheet
May 3rd by Tony Lawrence

Spreadsheets can be powerful tools, and particularly so in the hands of an expert user. A spreadsheet can be used to reorganize data and to extract information not otherwise available. For example, at a client site, an application report generates a listing of hourly billing, but can't give the cross-reference totals...
Text::Autoformat: Smart Text Reformatting with Perl
May 3rd by Tony Lawrence

I've been using http://groups-beta.google.com/ for Newsgroup posting for a while now. It's convenient for me because of my nomadic life style where I have different ISP's and often different machines with varying OSes. Google only needs a browser, and they aren't overly fussy about that, either.
Handling Missing Data in Inputs
May 3rd by Tony Lawrence

Missing data can be very annoying to a programmer. In fact, it is so annoying that very often we'll write separate programs to clean up data and eliminate unpleasant conditions so that the main program doesn't have to deal with it. Here, I'll show some examples of the kind of problems we see.
Building Perl projects with MakeMaker
May 1st by Sean Dague

If you've used UNIX or Linux for some period of time, you've probably written a few Perl programs to automate simple tasks. Each of these programs does something basic and simple that might otherwise take you 10 or 20 minutes to do by hand. In this article, Sean will show you how to convert just such a Perl program into a...
Web Log Analysis
Apr 30th by Tony Lawrence

There are many tools available to analyze web page statistics. One of the most popular is Analog, but any web search will turn up hundreds or perhaps even thousands more. There are also options like Hitbox which provides statistics gained through code included in your web pages.
Tips for Convenient CGI Scripting
Apr 28th by Eugene Logvinov

Any CGI programmer benefits from knowing and using ready-made libraries. In this article Eugene Logvinov shows how CGI modules taken from CPAN can not only help you to work effectively and conveniently, but can also provide you with an excellent code and reference library. Consequently, embedding POD (Plain Old...
Perl Net::FTP
Apr 27th by Tony Lawrence

Before the wide spread availability of Perl, I would script ftp transfers with .netrc, ksh scripts and other clumsy ways. None of those methods are fun, flexible or easy. On the other hand, Perl's Net::FTP module is all of that.
Fork and Exec with Perl
Apr 27th by Tony Lawrence

Recently I had a project that required a number of different programs that will mostly run all the time, but need to be restarted now and then with different parameters. Normally, the first thing I think of for a program that runs constantly is inittab or svc (daemontools). The svc facility is the more flexible of the two,...
Automate Perl Module Deployment
Apr 27th by Martin C. Brown

If you run Perl across many different computers of any sort, you know how frustrating it can be to install Perl extension modules across those machines. The administrative process is even worse if you have a Web server farm and need to keep each machine up to date with a set suite of extension modules for your installation.
Cultured Perl: Embedding Perl in database tables
Apr 27th by Teodor Zlatanov

In this installment, Ted looks at Perl and databases. Specifically, he works with the Class::DBI CPAN module and MySQL to introduce you to embedding Perl in database tables. Databases and the applications that use them are essential to today's computing infrastructures. They are everywhere, from plain-text databases...
Perl Input
Apr 25th by Tony Lawrence

Perl has wonderful I/O capabilities. I'm only going to cover input here: reading from files or standard input. There are two ways to do that (actually a lot more than two, but this is supposed to be introductory material): you can open a specific file, or you can pass files on the command line and either open them...
Perl Sorting
Apr 25th by Tony Lawrence

Arrays often need sorting. Perl has built-in ways to help you, but as usual, there's more than one way to do it. To play with the examples shown here, you'll need a file containing a few lines of words.
Perl Getopt and GetOptions
Apr 22nd by Tony Lawrence

Two Perl modules (Getopt and Getoptions::Long) work to extract program flags and arguments much like Getopt and Getopts do for shell programming. The Perl modules, especially GetOptions::Long, are much more powerful and flexible.
Running a CGI Script When Page Loads
Apr 21st by Will Bontrager

From statistics gathering to silent webmaster notification to email subscription solicitation, there can be any of many reasons for triggering a CGI script to run when a web page loads.
Tips for Convenient CGI Scripting
Apr 14th by Eugene Logvinov

Any CGI programmer benefits from knowing and using ready-made libraries. In this article Eugene Logvinov shows how CGI modules taken from CPAN can not only help you to work effectively and conveniently, but can also provide you with an excellent code and reference library. Consequently, embedding POD (Plain Old...


GET OUR NEWSLETTERS