in reply to Reading variables from a txt file

Consider using a .ini file. A quick search of CPAN reveals several modules for reading and writing in this format. Sorry, I have no practical experience to help you choose.