test($q,$dbh); sub test { my ($q,$dbh)=@_; #stuff in here }