my $count = 0; while (my @row = $sth->fetchrow_array) { $count++; printf " %-40s %s\n",$row[0],$row[1]; } unless ($count) { print "Keine Ergebniswerte!\n"; }