gryf has asked for the wisdom of the Perl Monks concerning the following question:
eg:
- produces a formated line of data from the database@row = $sth->fetchrow_array(); printf "%15s %12s %12s %12s %9s %5s $5s", @row;
But this same approach applied to the column headers prints only ARRAY(0x168218):
It doesn't much seem to matter if I replace @fieldNames with $sth->{NAME_uc} or @$fieldNames, I still don't get the array interpreted as a list, despite the fact that this appears to be the same methodology used to display the row data.@fieldNames = $sth->{NAME_uc}; printf "%15s %12s %12s %22s %9s %5s $5s", @fieldNames;
What hoops am I supposed to be jumping through here? Iterating through the column name array is a poor option because then I'd have to manually format the whole thing which seems a huge waste of code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing an array reference
by Tanktalus (Canon) on Jul 18, 2005 at 20:24 UTC | |
by gryf (Novice) on Jul 18, 2005 at 21:27 UTC | |
|
Re: printing an array reference
by cmeyer (Pilgrim) on Jul 18, 2005 at 20:26 UTC | |
|
Re: printing an array reference
by davidrw (Prior) on Jul 18, 2005 at 20:27 UTC | |
|
Re: printing an array reference
by shiza (Hermit) on Jul 18, 2005 at 20:38 UTC | |
|
Re: printing an array reference
by friedo (Prior) on Jul 18, 2005 at 20:24 UTC |