in reply to problem printing array elements -- printing # of lines in array instead

@command_array is an array, and you're using it in split where a scalar is expected.

An array in scalar context returns the number items.

You can print all items with print @command_array or by iterating over the values, and printing them one by one. Depends on what you want to achieve in the end.