Best way to create/assign variables based on strings

Sorry, this has veered off topic (so feel free to move it), but Before languages had richer control structures GOTO was necessarily ubiquitous in code. It was so ingrained in programmer habits and thought that even after the introduction of better control structures, its use persisted.