in reply to How to declare arrays and scalars together?
First, ( (),(),"0", () ) is the same as "0".
Second, no matter what list the right-hand side of the assignment returns, nothing will ever be assigned to $var. Everything will be assigned to @arr1. There's no way for the assignment to know how many elements of the list should be assigned to @arr1, how many to @arr2, etc.
If you're not assigning anything to more than one array, you can do what you want by moving the scalars to before the arrays.
my ($var, @arr1, @arr2, @arr3) = "0";
|
|---|