in reply to Reading variables from a txt file

You can `do` any valid Perl file (as it's described in perldoc -f do). This can be unsafe, though. You may want to use some data-storing modules (like YAML, for example) instead.
Sorry if my advice was wrong.