overrider has asked for the wisdom of the Perl Monks concerning the following question:
I get my Values from a Database, so the Code for that part is@data = (['Siemens','Nokia','Sony','Ericcson','Samsung'], [45000,12000,11000,18000,8000]);
So my Question is, while i am doing my fetchrow_array, how can i add the Values into my @data array of arrays, so that they are stored exactly like what i wrote above? Eg. so that Data Dumper would output it in this waymy $sth = $dbh->prepare("SELECT kunde,umsatz FROM db_kundenumsatz"); my @data; while (@data = $sth->fetchrow_array()){ #reading the data into an array of arrays just like the above }
I read up on Array of Arrays, and tried a many ways suggested, but the Data just wont come out in the correct Format. If anyone could show me the way, that would be awesome. Thanks and best regards!# i dont want to write this out by hand, but rather auto # create it via my Database Recordset that i fetched with # $sth->fetchrow_array() @data = (['Siemens','Nokia','Sony','Ericcson','Samsung'], [45000,12000,11000,18000,8000]); print Dumper(@data); $VAR1 = [ 'Siemens', 'Nokia', 'Sony', 'Ericcson', 'Samsung' ]; $VAR2 = [ 45000, 12000, 11000, 18000, 8000 ];
|
|---|