p6.pl
来自「simple perl programs to understand suse 」· PL 代码 · 共 37 行
PL
37 行
#!/usr/bin/perlprint "Content-type:text/html\n\n";$webmaster="root";($seconds,$minutes,$hour)=localtime(time);if($hour<=6){$greeting="Midnite to 6 am";}elsif(($hour>6)&&($hour<=12)){$greeting="6 am to afternoon";}elsif(($hour>12)&&($hour<=16)){$greeting="Afternoon to evening";}elsif(($hour>16)&&($hour<=23)){$greeting="Evening to till midnite";}open(CHK,"/usr/bin/w -h -s $webmaster|");if(<CHK>=~/$webmaster/){$inout="Webmaster is currently logged in";}else{$inout="Not logged in";}print"<html>";print"<body>";print $greeting;print $inout;print"</body>";print"</html>";exit(0);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?