加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl 中用shell.pm调用shell命令

发布时间:2020-12-16 00:41:51 所属栏目:大数据 来源:网络整理
导读:perl 中用shell.pm调用shell命令 code: #!/usr/bin/perl?-w? ? use?strict;? use?Shell?qw/webbench/;? ? my?@ array ?=?();? ? open?FILE,' ','url.txt'?or?die?"$!n";? ? while?( FILE )?{? ???????chomp;? ???????/(S+)/;? ???????push?@array,$1;? }?

perl 中用shell.pm调用shell命令

code:

 
 
  1. #!/usr/bin/perl?-w?
  2. ?
  3. use?strict;?
  4. use?Shell?qw/webbench/;?
  5. ?
  6. my?@array?=?();?
  7. ?
  8. open?FILE,'<','url.txt'?or?die?"$!n";?
  9. ?
  10. while?(<FILE>)?{?
  11. ???????chomp;?
  12. ???????/(S+)/;?
  13. ???????push?@array,$1;?
  14. }?
  15. ?
  16. close?FILE;?
  17. ?
  18. ?
  19. while?(1)?{?
  20. ?
  21. ???????for?my?$url?(@array)?{?
  22. ???????????my?$sh?=?Shell->new;?
  23. ???????????print?$sh->webbench("-c?500?-t?60?$url");?
  24. ???????}?
  25. ?
  26. sleep?5?
  27. ?
  28. }?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读