in reply to Array output as SCALAR
$MAIN[$seq_unique][$seq_position] = \(@array[1 .. 21]);
It seems you are making a couple mistakes with that.
First, \(@array[1 .. 21]) returns a list of references to the elements in that array slice. I.e. it is the same as:
That's probably not what you want.( \$array[1], \$array[2], . . ., \$array[21] );
Your other mistake is that you are assigning a list to a scalar. The result will be that the scalar will equal the last item in the list. So, you code is really the same as:
So, it's a reference to a scalar, and that's why, when you print it, you get that SCALAR(0x236ac8).$MAIN[$seq_unique][$seq_position] = \$array[21];
I'm not sure how to tell you to fix it because it isn't obvious what you want. Do you want that to hold a reference to an array, which is what it looks like you were trying to achieve with \(@array[1 .. 21])? Or do you want it to hold a readable string, which is what it seems you want if you are trying to print it out?
-sauoq "My two cents aren't worth a dime.";
|
|---|