in reply to Re^5: Perl list items
in thread Perl list items
You could, but that would be missing the point, and it appears that you're still confusing arrays and scalars. @A is not a scalar string; it is an array. Its first element, $A[0] is a string, which you created by assigning a string (the result of join) to it.
I don't know exactly what combine() does here, but it appears to be returning an array of references to arrays. If you just want the values from the first sub-array, there's no need to join them into a string and then split them out again. Just deference the array:
my @c = combine(5,@n); # get array of arrays my @A = @{$c[0]}; # get first sub-array
UPDATE: Thanks to Anonymous for the precedence correction.
Aaron B.
Available for small or large Perl jobs; see my home node.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Perl list items
by AnomalousMonk (Archbishop) on Jul 10, 2012 at 07:51 UTC | |
by Anonymous Monk on Jul 10, 2012 at 08:37 UTC | |
by AnomalousMonk (Archbishop) on Jul 10, 2012 at 09:13 UTC | |
by Anonymous Monk on Jul 10, 2012 at 09:24 UTC | |
by AnomalousMonk (Archbishop) on Jul 10, 2012 at 10:36 UTC |