diff options
author | Zack Weinberg <zackw@panix.com> | 2020-08-31 11:23:00 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-08-31 13:15:45 -0400 |
commit | 6d5e6ba9043df651fd1b1572ea1430c4269b091d (patch) | |
tree | 4657493a11dd15aac506706c9cd9a31355fc228f /lib | |
parent | 17c048d8593140bc178016fa46eac7d55e367266 (diff) | |
download | autoconf-6d5e6ba9043df651fd1b1572ea1430c4269b091d.tar.gz |
Rationalize ‘use’ order in Perl code.
All the Perl scripts and modules now ‘use’ other modules in the
following order:
- use 5.006; use strict; use warnings; in that order.
If a file was not already use-ing one of these three, it was added.
- The BEGIN block that adds the installation directory for the
Autom4te:: modules to @INC, if necessary.
- All stdlib modules whose name begins with a capital letter,
in ASCII sort order.
- All Autom4te:: modules, in ASCII sort order.
- ‘use vars qw (...)’, if any, last.
Also, ‘use foo qw (...)’ and @ISA lists have been sorted into ASCII
sort order. (@EXPORT lists, which often follow immediately after @ISA
lists, have *not* been sorted, as these appear to have been organized
semantically in many cases.) qw delimiters have been normalized to
round parentheses with a space between the qw and the open paren.
* bin/autoheader.in, bin/autom4te.in, bin/autoreconf.in
* bin/autoscan.in, bin/autoupdate.in, bin/ifnames.in
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm
* lib/Autom4te/Channels.pm, lib/Autom4te/Configure_ac.pm
* lib/Autom4te/FileUtils.pm, lib/Autom4te/General.pm
* lib/Autom4te/Getopt.pm, lib/Autom4te/Request.pm
* lib/Autom4te/XFile.pm: Rationalize order and format of ‘use’
directives and @ISA lists. Add any of ‘use 5.006’, ‘use strict’,
and ‘use warnings’ that was not already present.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Autom4te/C4che.pm | 11 | ||||
-rw-r--r-- | lib/Autom4te/ChannelDefs.pm | 4 | ||||
-rw-r--r-- | lib/Autom4te/Channels.pm | 5 | ||||
-rw-r--r-- | lib/Autom4te/Configure_ac.pm | 7 | ||||
-rw-r--r-- | lib/Autom4te/FileUtils.pm | 7 | ||||
-rw-r--r-- | lib/Autom4te/General.pm | 16 | ||||
-rw-r--r-- | lib/Autom4te/Getopt.pm | 10 | ||||
-rw-r--r-- | lib/Autom4te/Request.pm | 4 | ||||
-rw-r--r-- | lib/Autom4te/XFile.pm | 19 |
9 files changed, 47 insertions, 36 deletions
diff --git a/lib/Autom4te/C4che.pm b/lib/Autom4te/C4che.pm index 6226cd63..2032f59c 100644 --- a/lib/Autom4te/C4che.pm +++ b/lib/Autom4te/C4che.pm @@ -31,12 +31,15 @@ This Perl module handles the cache of M4 runs used by autom4te. =cut -use Data::Dumper; -use Autom4te::Request; -use Carp; +use 5.006; use strict; use warnings; +use Carp; +use Data::Dumper; + +use Autom4te::Request; + =over 4 =item @request @@ -50,7 +53,7 @@ work with "my" vars, and I do not know whether the current behavior =cut -use vars qw(@request); +use vars qw (@request); =item C<$req = Autom4te::C4che-E<gt>retrieve (%attr)> diff --git a/lib/Autom4te/ChannelDefs.pm b/lib/Autom4te/ChannelDefs.pm index c706b6dc..24e4bb61 100644 --- a/lib/Autom4te/ChannelDefs.pm +++ b/lib/Autom4te/ChannelDefs.pm @@ -50,10 +50,10 @@ shorthand function to output on specific channels. use 5.006; use strict; use warnings; -use Exporter; -use vars qw (@ISA @EXPORT); +use Exporter; +use vars qw (@EXPORT @ISA); @ISA = qw (Exporter); @EXPORT = qw (&prog_error &error &fatal &verb &switch_warning &parse_WARNINGS &parse_warnings); diff --git a/lib/Autom4te/Channels.pm b/lib/Autom4te/Channels.pm index ffe7361c..f2f4b997 100644 --- a/lib/Autom4te/Channels.pm +++ b/lib/Autom4te/Channels.pm @@ -69,11 +69,12 @@ etc.) that can also be overridden on a per-message basis. use 5.006; use strict; use warnings; -use Exporter; + use Carp; +use Exporter; use File::Basename; -use vars qw (@ISA @EXPORT %channels $me); +use vars qw (@EXPORT @ISA %channels $me); @ISA = qw (Exporter); @EXPORT = qw ($exit_code $warnings_are_errors diff --git a/lib/Autom4te/Configure_ac.pm b/lib/Autom4te/Configure_ac.pm index bf3ad99b..f84e7336 100644 --- a/lib/Autom4te/Configure_ac.pm +++ b/lib/Autom4te/Configure_ac.pm @@ -23,12 +23,13 @@ package Autom4te::Configure_ac; use 5.006; use strict; use warnings; + use Exporter; -use Autom4te::Channels; -use Autom4te::ChannelDefs; -use vars qw (@ISA @EXPORT); +use Autom4te::ChannelDefs; +use Autom4te::Channels; +use vars qw (@EXPORT @ISA); @ISA = qw (Exporter); @EXPORT = qw (&find_configure_ac &require_configure_ac); diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm index 7b7959f9..ef1a2a7f 100644 --- a/lib/Autom4te/FileUtils.pm +++ b/lib/Autom4te/FileUtils.pm @@ -37,14 +37,15 @@ This perl module provides various general purpose file handling functions. use 5.006; use strict; use warnings; + use Exporter; use File::stat; use IO::File; -use Autom4te::Channels; -use Autom4te::ChannelDefs; -use vars qw (@ISA @EXPORT); +use Autom4te::ChannelDefs; +use Autom4te::Channels; +use vars qw (@EXPORT @ISA); @ISA = qw (Exporter); @EXPORT = qw (&contents &find_file &mtime diff --git a/lib/Autom4te/General.pm b/lib/Autom4te/General.pm index 76dbd426..922e4767 100644 --- a/lib/Autom4te/General.pm +++ b/lib/Autom4te/General.pm @@ -33,19 +33,21 @@ used in several executables of the Autoconf package. =cut use 5.006; +use strict; +use warnings; + +use Carp; use Exporter; -use Autom4te::ChannelDefs; -use Autom4te::Channels; -use Autom4te::Getopt (); use File::Basename; use File::Path (); use File::stat; use IO::File; -use Carp; -use strict; -use warnings; -use vars qw (@ISA @EXPORT); +use Autom4te::ChannelDefs; +use Autom4te::Channels; +use Autom4te::Getopt (); + +use vars qw (@EXPORT @ISA); @ISA = qw (Exporter); # Variables we define and export. diff --git a/lib/Autom4te/Getopt.pm b/lib/Autom4te/Getopt.pm index 42133e32..f70a5c58 100644 --- a/lib/Autom4te/Getopt.pm +++ b/lib/Autom4te/Getopt.pm @@ -33,14 +33,16 @@ line options in conformance to the GNU Coding standards. use 5.006; use strict; use warnings FATAL => 'all'; + +use Carp qw (confess croak); use Exporter (); use Getopt::Long (); -use Autom4te::ChannelDefs qw/fatal/; -use Carp qw/croak confess/; -use vars qw (@ISA @EXPORT); +use Autom4te::ChannelDefs qw (fatal); + +use vars qw (@EXPORT @ISA); @ISA = qw (Exporter); -@EXPORT= qw/getopt/; +@EXPORT = qw (getopt); =item C<parse_options (%option)> diff --git a/lib/Autom4te/Request.pm b/lib/Autom4te/Request.pm index 5db75463..0b97615d 100644 --- a/lib/Autom4te/Request.pm +++ b/lib/Autom4te/Request.pm @@ -32,10 +32,12 @@ used in several executables of the Autoconf and Automake packages. =cut +use 5.006; use strict; use warnings; -use Class::Struct; + use Carp; +use Class::Struct; use Data::Dumper; struct diff --git a/lib/Autom4te/XFile.pm b/lib/Autom4te/XFile.pm index 538d383b..8a49ac1a 100644 --- a/lib/Autom4te/XFile.pm +++ b/lib/Autom4te/XFile.pm @@ -72,23 +72,22 @@ and C<getlines> methods to translate C<\r\n> to C<\n>. use 5.006; use strict; use warnings; -use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA); + use Carp; +use DynaLoader; use Errno; -use IO::File; +use Exporter; use File::Basename; +use IO::File; + use Autom4te::ChannelDefs; -use Autom4te::Channels qw(msg); +use Autom4te::Channels qw (msg); use Autom4te::FileUtils; -require Exporter; -require DynaLoader; - -@ISA = qw(IO::File Exporter DynaLoader); - -$VERSION = "1.2"; - +use vars qw ($AUTOLOAD @EXPORT @EXPORT_OK @ISA $VERSION); +@ISA = qw (DynaLoader Exporter IO::File); @EXPORT = @IO::File::EXPORT; +$VERSION = "1.2"; eval { # Make all Fcntl O_XXX and LOCK_XXX constants available for importing |