Miscellany
public text v1 · immutable elsif ($MSG[0] eq 'ACCESS') {
if ($MSG[1] eq 'OP') {
if ($MSG[2] eq 'ADD') {
$auth_op{$MSG[3]} = 1;
print "Added $MSG[3] as an OP\n";
}
elsif ($MSG[2] eq 'DEL') {
delete $auth_op{$MSG[3]};
}
elsif ($MSG[2] eq 'FLUSH') {
delete @auth_op{(keys %auth_op)};
}
elsif ($MSG[2] eq 'SAVE') {
open $AUTH_OP, ">", "AUTH_HOSTS_OP" or die "Couldn't open auth file\n";
print $AUTH_OP values(%auth_op) . "\n";
close($AUTH_OP);
}
else {
print $sock "PRIVMSG $to :Syntax incorrect: ACESSS [ADD/DEL/FLUSH/SAVE]\r\n";
}
}
}