Reading output from command into Perl array

前端 未结 3 1092
无人及你
无人及你 2020-12-20 13:26

I want to get the output of a command into an array — like this:

my @output = `$cmd`;

but it seems that the output from the command

3条回答
  •  情歌与酒
    2020-12-20 14:13

    Enable automatic error checks:

    require IPC::System::Simple;
    use autodie qw(:all);
    ⋮
    my @output = `$cmd`;
    

提交回复
热议问题