Author: Andreas Tille <tille@debian.org>
Last-Update: 2025-02-11
Description: Fix some Perl issues that make autopkgtest fail

--- a/Mon/Config.pm
+++ b/Mon/Config.pm
@@ -25,10 +25,13 @@ require Exporter;
 require 5.004;
 use strict;
 
-@ISA = qw(Exporter);
-@EXPORT_OK = qw($VERSION);
+my @ISA = qw(Exporter);
+my @EXPORT_OK = qw($VERSION);
 
-$VERSION = "1.0000";
+my $VERSION = "1.0000";
+
+use Cwd qw(getcwd);
+my $PWD = getcwd();
 
 sub new
 {
@@ -96,9 +99,10 @@ sub read
     
     else
     {
+	my $CF = $args{file};
 	if (!open (CFG, $CF))
 	{
-	    $self->{"error"} = "could not open $args{file}: $!"
+	    $self->{"error"} = "could not open $args{file}: $!";
 	    return $self->{"error"};
 	}
     }
@@ -107,7 +111,7 @@ sub read
     # buffers to hold the new un-committed config
     #
     my %new_alias = ();
-    my %new_CF = %CF;
+    my %new_CF = ();
     my %new_groups;
     my %new_watch;
 
@@ -356,7 +360,7 @@ sub read
 	    $hosts = $2;
 	    %disabled = ();
 
-	    foreach $h (grep (/^\*/, @{$groups{$curgroup}}))
+	    foreach my $h (grep (/^\*/, @{$groups{$curgroup}}))
 	    {
 		# We have to make $i = $h because $h is actually
 		# a pointer to %groups and will modify it.
--- a/Mon/Client.pm
+++ b/Mon/Client.pm
@@ -39,7 +39,7 @@ use vars grep { /^\W/ } @EXPORT_OK;
 
 $VERSION = "1.0000";
 
-my ($STAT_FAIL, $STAT_OK, $STAT_COLDSTART, $STAT_WARMSTART, $STAT_LINKDOWN,
+our ($STAT_FAIL, $STAT_OK, $STAT_COLDSTART, $STAT_WARMSTART, $STAT_LINKDOWN,
 $STAT_UNKNOWN, $STAT_TIMEOUT, $STAT_UNTESTED, $STAT_DEPEND, $STAT_WARN) = (0..9);
 
 my ($TRAP_COLDSTART, $TRAP_WARMSTART, $TRAP_LINKDOWN, $TRAP_LINKUP,
