in reply to passing data using MIME::Lite

Your basic mistake is how you are trying to tget the data back to MIME::LITE. Try something like this:
sub sql { my $body_text; my @output = $sqlCount->execute; while (@output=$sqlCount->fetchrow_array) { $body_text .= join ":", @output; } $sqlCount->finish(); $dbcon->disconnect(); return $body_text; }
Then at least you will be returning a scalar from your sql subroutine and the data just might get into the email. In fact I haven't tested this code, but it is almost identical to something I do nearly every day on one of my production machines.

UPDATE And deibyz picked the other problem. In the message object the data should be placed as he does, or in my example, simply:

Data => sql()
jdtoronto