#!/usr/bin/perl use strict; use warnings; my $dir = q{/path/to/dir}; my $t_spec = q{xyz}; my $part_no = q{123AZ789}; my $chg_lvl = q{3.2}; my $int_lock = q{LLL}; my $errFile = qq{/$view_tag/app_hwt/heavy_duty/part_no_update.err}; open my $errFH, q{>>}, $errFile or die qq{append: $errFile: $!\n}; my $errFormat = qq{%-13s %10s %7s %5s %4s - %5s\n}; printf $errFH $errFormat, $dir, $t_spec, $part_no, $chg_lvl, $int_lock, q{error}; close $errFH or die qq{close: $errFile: $!\n};