You may have seen this already, but cpan does have a fft module: math::fft.
From what I saw it only handles a single array, and I don't remember much of the tiny bit I learned about fft in school...but it might be easier to use those as a base and build up to multiple dimensions.....
Or if it's possible to flatten the data, I don't recall.