For a safe (and syntactically convenient) way to do this, check out Exporter::Dispatch.
In reply to Re: Automating dispatch tables by jryan in thread Automating dispatch tables by BUU