In your loop, you are overwriting all previously stored values:
@cmdout = $_;
Maybe you wanted to push? Or maybe you wanted to directly read the output of the command into the array?
my @cmdout = qx($BACKUPSTATE);
See perlop for qx() (in "Quote-Like Operators").
In reply to Re: Why cant i save output of tasklist.exe in an array?
by Corion
in thread Why cant i save output of tasklist.exe in an array?
by swissknife
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |