How do I get the output of an external command in Perl?

后端 未结 7 1410
闹比i
闹比i 2020-12-03 13:45

I want to have output of Windows command-line program (say, powercfg -l) written into a file which is created using Perl and then read the file line by line in

7条回答
  •  醉梦人生
    2020-12-03 14:14

    Try using > operator to forward the output to a file, like:

    powercfg -l > output.txt
    

    And then open output.txt and process it.

提交回复
热议问题