Bill Harpley wrote:
Suppose I have a multidimensional array of the form:
@array[names][values]
For example, I have a list of database field names and the value
associated with each one.
Is this what you mean:
my @record = (
[ col1 => 'val1' ],
[ col2 => 'val2' ],
);
If this was a single dimensional array called @list, I could create an
output line in CSV format by using the 'join' command like this:
$line= join ',' , @list;
Is there a simple way to just take a single column of a multidimensional
array and use 'join' to create a CSV output line?
Yes.
my $line = join ',', @{ $record[0] };
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/