Any form of caching will make your program fast.
I don't know if Freezing/Dumping a hash to a file is the best option, but it is very simple and will probably work so why not. You could also use mod_perl (calculate on startup, requests read it from mem), smart use of a database (save your results so it) or saving the data to an XML file.