I am presently trying to refactor a script which has a reliance upon three hashes (simple hashes), initialized at the outset of the script. As a whole, these hash values occupy on the hundred lines within the script. To be able to improve overall readability and hygiene from the code, must i store these details outdoors from the script and browse within the information in the beginning? The information itself ought to be mostly static (individual records might have to be transformed occasionally).

If so, wouldso would Time passes about storing it inside a database/recommended storage medium? (I am a noob if this involves SQL).

Seems like you've configuration data. The Mastering Perl book has a chapter talking about several options.

I'd most likely use something similar to JSON or among the formats based on Config::Any. For straightforward mappings an INI format will most likely suffice. I am inclined to use JSON for additional complex situations.

I wouldn't store it inside a separate file or database simply because it'll decelerate your program for not good reason. Just move your overall initialization code to some separate constants.pl file as well as in your primary file do require "constants.pl"

Be sure to improve your hashes's declaeration from

to really make it visible across files.