我正在学习 Perl,但我遇到了一个问题。我设计了一个简单的程序,但是当我运行它时会出现这个错误:
Can not exec "usleep": The file or directory does not exist at line 22 example.pl.
Can not exec "usleep": The file or directory does not exist at line 65 example.pl.
怎么解决?谢谢。
您可能希望查看Time::HiRes模块,而不是执行外部程序。这可以以更直接的方式完成您想要的操作。
use Time::HiRes 'usleep';
usleep($microseconds);