//CGI and Perl

Cultured Perl: Embedding Perl in database tables

2010-05-26T11:27:33+00:00 April 27th, 2005|CGI and Perl|

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 such as the UNIX® /etc/passwd file to large databases such as those that track shopping habits or fight credit card fraud.

Perl Input

2010-05-26T11:27:50+00:00 April 25th, 2005|CGI and Perl|

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 individually or just ignore the whole thing and pretend everything is coming from STDIN.

Perl Sorting

2010-05-26T11:27:56+00:00 April 25th, 2005|CGI and Perl|

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

2010-05-26T11:28:33+00:00 April 22nd, 2005|CGI and Perl|

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.

Tips for Convenient CGI Scripting

2010-05-26T11:35:14+00:00 April 14th, 2005|CGI and Perl|

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 Documentation) in the module turns out to be a good choice.

Optimize Perl

2010-05-26T11:37:48+00:00 April 11th, 2005|CGI and Perl|

Perl is an incredibly flexible language, but its ease of use can lead to some sloppy and lazy programming habits. We're all guilty of them, but there are some quick steps you can take to improve the performance of your Perl applications. In this article, I'll look at the key areas of optimization, which solutions work and which don't, and how to continue to build and extend your applications with optimization and speed in mind.

Cultured Perl: Genetic Algorithms Applied with Perl

2010-05-26T16:54:43+00:00 November 3rd, 2004|CGI and Perl|

Based on the Darwinian principle of survival of the fittest, genetic programming uses mutation and replication to produce algorithms for creating ever-improving computer programs. In this column, you'll get to know the genetic algorithm in simple terms. Ted provides Perl implementations for some specific tasks, which you can adapt for generic use. To demonstrate the genetic algorithm, Ted breeds numbers for fitness to a formula, and letters to form English words.

Using Perl to Create Reusable Web Applications

2010-05-26T16:56:05+00:00 September 21st, 2004|CGI and Perl|

Perl is a convenient and effective tool for complex Web applications development. However, even experienced programmers resist Perl because it seems difficult to learn and use. This article demonstrates that object-oriented implementation of Perl simplifies the effort and could be much more effective than other Web technologies, especially with separate design and application functionality.