"http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html";
BEGIN {
- # These must be declared "our" so that the actual variable with the data
- # (in the symbol table) will remain available after the BEGIN block.
- #
- # These should be changed to constants eventually, since they should not
- # change after the script is started.
my $ZONE = '';
- our $help = '';
- our $version = '';
+ my $want_help = '';
+ my $want_version = '';
+
# Set this to 1 or higher to get debug output in the log file.
my $DEBUG = 1;
my $TestingMode = 0;
- GetOptions('help' => \$help,
- 'version' => \$version,
+ GetOptions('help' => \$want_help,
+ 'version' => \$want_version,
'zone|z|s=s' => \$ZONE,
'tstampcheck=i' => \$TSTAMPCHECK,
'nomail=i' => \$NOMAIL,
constant->import(NOMAIL => $NOMAIL);
constant->import(TSTAMPCHECK => $TSTAMPCHECK);
+ constant->import(WANT_HELP => $want_help);
+ constant->import(WANT_VERSION => $want_version);
+
constant->import(IN_TEST_MODE => $TestingMode);
if ($TestingMode) {
}
}
-our $help;
-our $version;
-
-if ($version) {
+if (WANT_VERSION) {
print "\nThis is $NAME protocol version $VERSION ($DATE)\n";
print $COPYRIGHT_NOTICE;
print "License: $LICENSE\n";
exit 0;
}
-pod2usage(-verbose => 1, -exitval => 0) if ($help);
+pod2usage(-verbose => 1, -exitval => 0) if WANT_HELP;
pod2usage(-message => 'ERROR: Required parameter not given or invalid.',
-verbose => 0, -exitval => 2)
if ((ZONE ne 'ftp') && (ZONE ne 'alpha') && (ZONE ne 'distros'));