Perl code patch contributed by "Kurt J. Pires" <kjpires@iat.com>