It all goes wrong on your line 46. As you'll see from the documentation, the second argument to split is a scalar value. Therefore your array is evaluated in scalar context and returns the number of elements in the array.
It's also (as always) worth using strict and warnings. In this case, you'll see warnings like "Scalar value @command_array_split[0] better written as $command_array_split[0]".
In reply to Re: problem printing array elements -- printing # of lines in array instead
by davorg
in thread problem printing array elements -- printing # of lines in array instead
by sqspat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |