$rtoken_vars->[_TOKEN_] = $token;
}
+ # clean up spaces in package identifiers, like
+ # "package Bob::Dog;"
+ if ($token =~ /^package\s/) {
+ $token =~ s/\s+/ /g;
+ $rtoken_vars->[_TOKEN_] = $token;
+ }
+
# trim identifiers of trailing blanks which can occur
# under some unusual circumstances, such as if the
# identifier 'witch' has trailing blanks on input here:
}
# break before all package declarations
- elsif ( $leading_token =~ /^(package\s)/ ) {
+ elsif ( substr( $leading_token, 0, 8 ) eq 'package ' ) {
$want_blank = $rOpts->{'blank-lines-before-packages'};
}
}
=over 4
+=item B<removed excess spaces in a package declaration>
+
+Testing revealed that for a line such as
+
+ package Bob::Dog;
+
+which has extra spaces or even tabs after the keyword 'package', the
+extra spaces or tabs were not being removed. This was fixed 28 Nov 2020.
+The line now formats to
+
+ package Bob::Dog;
+
=item B<do not automatically delete closing side comments with --indent-only>
For the parameter combination --indent-only and --closing-side-comments, old