Writing Configuration Files in Perl

in Perl Tips, Files & Directories
by William Ward on July 17, 2003 1:00 am

It is often useful to have a configuration file for a program, where you can specify certain variables that are used in the program. Examples of configuration parameters might include files, email addresses, usernames, or passwords the program uses, etc. If your Perl program needs to read a configuration file, there are lots of ways to do it.

(more…)

Validating Data Types

in Perl Tips, Regular Expressions
by William Ward on July 17, 2003 1:00 am

Perl is not a strongly-typed language. A scalar can hold a string or a number or a reference. But sometimes you need to know what it contains, for example if you are communicating with a strongly-typed system like a relational database, or even if you just want to make sure the user entered a number for his age rather than "old enough" or something of that kind.

(more…)