Re: Use join on multi-dimensional array

2009-02-27 Thread John W. Krahn
Jenda Krynicky wrote: From: "Bill Harpley" 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. If this was a single dimensional array called @list, I could create an output line

Re: Use join on multi-dimensional array

2009-02-27 Thread Jim Gibson
On 2/27/09 Fri Feb 27, 2009 5:21 AM, "Bill Harpley" scribbled: > Suppose I have a multidimensional array of the form: > > @array[names][values] There is no such construct in Perl. An array is a one-dimensional list of scalar values, indexed by integers. You can emulate multi-dimensional array

Re: Use join on multi-dimensional array

2009-02-27 Thread Jenda Krynicky
From: "Bill Harpley" > 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. > > If this was a single dimensional array called @list, I could create an > output line in CSV

Re: Use join on multi-dimensional array

2009-02-27 Thread Gunnar Hjalmarsson
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' ], );

Use join on multi-dimensional array

2009-02-27 Thread Bill Harpley
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. If this was a single dimensional array called @list, I could create an output line in CSV format by using the 'join' command like