Table of Contents

Bondage and Discipline

Perl is a very flexible language. It is designed as a hacking tool, for quick sysadmin magic. It can do quite a bit more besides, but being small and powerful is a core Perl feature. Earlier on I said Perl is not a bondage and discipline language -- to qualify that, it doesn't have to be. However, there is a time and place for everything.

For tiny scripts you don't want to be declaring variables, typecasting and generally spending more time obeying rules than you do getting the job done. So, Perl doesn't force you to do all of these good programming practices. However, not all your programs are going to be five-minute hacks. Some will be pretty large. Therefore, some Discipline is in order.

Perl has two primary methods of enforcing discipline. They are: