From 7e4a3a971b0f288e27d7d6541547d010ae74f3c3 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 6 Sep 2020 17:59:12 -0700 Subject: [PATCH] add AUTOLOAD subs to better catch programming errors --- lib/Perl/Tidy.pm | 19 +++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 18 ++++++++++++++++++ lib/Perl/Tidy/HtmlWriter.pm | 19 +++++++++++++++++++ lib/Perl/Tidy/Tokenizer.pm | 19 +++++++++++++++++++ lib/Perl/Tidy/VerticalAligner.pm | 19 +++++++++++++++++++ 5 files changed, 94 insertions(+) diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index a7a71819..7db691aa 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -113,6 +113,25 @@ BEGIN { $VERSION = '20200907'; } +sub AUTOLOAD { + + # Catch any undefined sub calls so that we are sure to get + # some diagnostic information. This sub should never be called + # except for a programming error. + our $AUTOLOAD; + my ( $pkg, $fname, $lno ) = caller(); + print STDERR <