We prove an exact formula for the variance of the divisor function over short intervals in \({\mathcal {A}}:= {\mathbb {F}}_q [T]\) , where q is a prime power; and for correlations of the form \(d(A) d(A+B)\) , where we average both A and B over certain intervals in \({\mathcal {A}}\) . We also obtain an exact formula for correlations of the form \(d(KQ+N) d (N)\) , where Q is prime and K and N are averaged over certain intervals with \({{\,\textrm{deg}\,}}N \le {{\,\textrm{deg}\,}}Q -1 \le {{\,\textrm{deg}\,}}K\) ; and we demonstrate that \(d(KQ+N)\) and d(N) are uncorrelated. We generalize our results to \(\sigma _z\) defined by \(\sigma _z (A):= \sum _{E \mid A} |A |^z\) for all monics \(A \in {\mathcal {A}}\) . Our approach is to use the orthogonality relations of additive characters on \({\mathbb {F}}_q\) to translate the problems to ones involving the ranks of Hankel matrices over \({\mathbb {F}}_q\) . We prove several results regarding the rank and kernel structure of these matrices, thus demonstrating their number-theoretic properties. We also discuss extending our method to other divisor sums, such as those involving \(d_k\) .