in reply to Why cant i save output of tasklist.exe in an array?

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").