📄 check_time.pl
字号:
################
sub check_time{
open(TIME,"<$homedir/check_time.txt")|| &error("无法打开文件check_time.txt");
@list=<TIME>;
close(TIME);
$current_time=$now_sec;
foreach $line(@list){
@check=split(/=/,$line);
$temp=$current_time-@check[1];
if($temp>$days){
unlink ("$homedir/temp/@check[0].txt");
@list = grep{ !(/$line/i) } @list;
}#如果超过时间,就删除时间纪录档
unless(-e "$homedir/temp/@check[0].txt"){
@list = grep{ !(/$line/i) } @list;
}#如果聊天者已离开,就删除时间纪录档
}
open(TIME,">$homedir/check_time.txt")|| &error("无法打开文件check_time.txt");
print TIME @list;
close(TIME);
open(TIME,"<$homedir/createroom.txt")|| &error("无法打开文件createroom.txt");
@list=<TIME>;
close(TIME);
$current_time=$now_sec;
foreach $line(@list){
@check=split(/=/,$line);
$temp=$current_time-@check[2];
if($temp>$days){
unlink ("$homedir/temp/rooms/@check[0]");
@list = grep{ !(/$line/i) } @list;
}#如果超过时间,就删除时间纪录档
unless (-e "$homedir/temp/rooms/@check[0]") {
@list = grep{ !(/$line/i) } @list;
}
}
open(TIME,">$homedir/createroom.txt")|| &error("无法打开文件createroom.txt");
print TIME @list;
close(TIME);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -