in reply to formatting output from a mysql query in column format

Here's an example of the type of thing you could do in this situation:

use strict; use warnings; my @labels = qw{First: Middle: Last: Age:}; my @sql_data = (q{John}, q{}, q{Smith}, 20); my $no_value = q{*NO_VALUE_SUPPLIED*}; my $counter = 0; print map { ($labels[$counter++], qq{\t}, ($_ ne q{} ? $_ : $no_value), qq{\n} +) } @sql_data;

Which produces:

First: John Middle: *NO_VALUE_SUPPLIED* Last: Smith Age: 20

As you're new to Perl, here's a few pointers:

-- Ken