]> git.donarmstrong.com Git - perltidy.git/blobdiff - lib/Perl/Tidy/IOScalarArray.pm
New upstream version 20210717
[perltidy.git] / lib / Perl / Tidy / IOScalarArray.pm
index 17686eb64429fd80ac7d51a32b2886c7b84fa71a..640459b85134fc83445297c702886bc608591ef5 100644 (file)
@@ -14,7 +14,33 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20200110';
+our $VERSION = '20210717';
+
+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;
+    return if ( $AUTOLOAD =~ /\bDESTROY$/ );
+    my ( $pkg, $fname, $lno ) = caller();
+    my $my_package = __PACKAGE__;
+    print STDERR <<EOM;
+======================================================================
+Error detected in package '$my_package', version $VERSION
+Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
+Called from package: '$pkg'  
+Called from File '$fname'  at line '$lno'
+This error is probably due to a recent programming change
+======================================================================
+EOM
+    exit 1;
+}
+
+sub DESTROY {
+
+    # required to avoid call to AUTOLOAD in some versions of perl
+}
 
 sub new {
     my ( $package, $rarray, $mode ) = @_;