diff --git a/AppUser.pm b/AppUser.pm index e1f3460..ef68340 100644 --- a/AppUser.pm +++ b/AppUser.pm @@ -66,8 +66,13 @@ use constant ADMIN_TYPE => 3; # User type for admin users. sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; + # Note this doesn't use the superclass constructor, as it may be called before + # the objects the superclass checks for are acutally available + my $self = { + @_, + }; - return $class -> SUPER::new(@_); + return bless $self, $class; } diff --git a/Auth.pm b/Auth.pm index 33b5b8f..9b41995 100644 --- a/Auth.pm +++ b/Auth.pm @@ -57,7 +57,13 @@ use AuthMethods; sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; - return $class -> SUPER::new(@_); + # Note this doesn't use the superclass constructor, as it may be called before + # the objects the superclass checks for are acutally available + my $self = { + @_, + }; + + return bless $self, $class; } diff --git a/System.pm b/System.pm index 8ab920a..ce0ebc3 100644 --- a/System.pm +++ b/System.pm @@ -40,8 +40,13 @@ use base qw(SystemModule); sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; + # Note this doesn't use the superclass constructor, as it may be called before + # the objects the superclass checks for are acutally available + my $self = { + @_, + }; - return $class -> SUPER::new(@_); + return bless $self, $class; }