remove 5.10.1 isms (//= etc)

This commit is contained in:
Dirk Koopman 2022-01-21 18:35:47 +00:00
parent d8d7d25e92
commit 7e9852009e
4 changed files with 11 additions and 12 deletions

View File

@ -13,7 +13,7 @@ package DXCommandmode;
@ISA = qw(DXChannel);
use 5.10.1;
use 5.8.1;
use POSIX qw(:math_h);
use DXUtil;
@ -801,7 +801,6 @@ sub clear_cmd_cache
sub valid_package_name {
my $string = shift;
$string =~ s|([^A-Za-z0-9_/])|sprintf("_%2x",unpack("C",$1))|eg;
$string =~ s|/|_|g;
return "cmd_$string";
}
@ -836,7 +835,7 @@ sub find_cmd_name {
};
#wrap the code into a subroutine inside our unique package
my $eval = qq(package DXCommandmode::$package; use 5.10.1; use POSIX qw{:math_h}; use DXLog; use DXDebug; use DXUser; use DXUtil; our \@ISA = qw{DXCommandmode}; );
my $eval = qq(package DXCommandmode::$package; use 5.8.1; use POSIX qw{:math_h}; use DXLog; use DXDebug; use DXUser; use DXUtil; our \@ISA = qw{DXCommandmode}; );
if ($sub =~ m|\s*sub\s+handle\n|) {

View File

@ -801,7 +801,7 @@ sub check_add_user
# this is to fix a problem I introduced some build ago by using this function for users
# whereas it was only being used for nodes.
if ($user->is_user && $user->lockout && ($user->priv // 0) == 1) {
if ($user->is_user && $user->lockout && ($user->priv || 0) == 1) {
$user->priv(0);
$user->lockout(0);
dbg("DXProt: PC92 user record for $call depriv'd and unlocked");
@ -1571,8 +1571,8 @@ sub _decode_pc92_call
my $version = $part[1] || 0;
my $build = $part[2] || 0;
my $ip = $part[3] || '';
if ($version =~ /[,.]/) {
if (length $version > 4 && $version =~ /[,\.][\da-f]{1,4}/i) {
$ip = $version;
$version = 0;
}
@ -1666,7 +1666,7 @@ sub _add_thingy
} elsif ($user->is_spider && ($version < 3000 || ($version > 4000 && $version < 5455))) {
unless ($version == 5000 && $build == 0) {
$user->sort('A');
$build //= 0;
$build ||= 0;
dbg("PCProt::_add_thingy node $call v: $version b: $build sort ($old) downgraded to " . $user->sort);
}
}
@ -2022,7 +2022,7 @@ sub handle_92
my $oldbuild = $parent->build || 0;
my $oldversion = $parent->version || 0;
my $user = check_add_user($parent->call, 'S');
my $oldsort = $user->sort // '';
my $oldsort = $user->sort || '';
dbg("PCProt PC92 K v: $version ov: $oldversion b: $build ob: $oldbuild pk: " . ($parent->K || '0') . " uk: " . ($user->K || 0)) if isdbg('pc92k');

View File

@ -141,8 +141,8 @@ use vars qw(@inqueue $systime $starttime $lockfn @outstanding_connects
);
$clusteraddr //= '127.0.0.1'; # cluster tcp host address - used for things like console.pl
$clusterport //= 27754; # cluster tcp port
$clusteraddr ||= '127.0.0.1'; # cluster tcp host address - used for things like console.pl
$clusterport ||= 27754; # cluster tcp port
@inqueue = (); # the main input queue, an array of hashes
$systime = 0; # the time now (in seconds)
$starttime = 0; # the starting time of the cluster

View File

@ -50,8 +50,8 @@ use Console;
# initialisation
#
$clusteraddr //= '127.0.0.1';
$clusterport //= 27754;
$clusteraddr ||= '127.0.0.1';
$clusterport ||= 27754;
$call = ""; # the callsign being used
$node = ""; # the node callsign being used