use DBmanager qw ($dbh $table); sub tableinfo { my ($dbh, $table) = @_; $table = "download"; my $sth = $dbh->prepare("QUERY"); my $tables = $sth->{'NUM_OF_FIELDS'}; print Dumper($tables); } &tableinfo ($dbh, $table);