No such thing as a small change | |
PerlMonks |
Re: problem printing array elements -- printing # of lines in array insteadby davorg (Chancellor) |
on Jul 13, 2009 at 13:42 UTC ( [id://779584]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|