At different points in the life of a program, different levels of auditing will be appropriate. While the program is being developed and tested it is common practice to have a much more detailed audit trail than when it is being used day to day in a production environment. For this reason, it is often useful to write auditing code that allows you to generate different levels of output depending on the value of a variable that defines the audit level. This variable might be read from an environment variable like this: my $audit_level = $ENV{AUDIT_LEVEL} || 0; In this example we set the value of $audit_level from the environment variable AUDIT_LEVEL. If this level is not set then we default to 0, the minimum level. Later in the script we can write code like: print LOG 'Starting processing at ', scalar localtime, "\n" if $audit_level > 0; to print audit information to the previously opened file handle, LOG. Standards for audit trails will typically vary from company to company, but some things that you might consider auditing are:  start and end times of the process  source and sink parameters (filenames, database connection parameters, etc.)  ID of every record processed  results of each data translation  final count of records processed