I have a long list of variables to which I want to allocate values. The values to be allocated populate a hash and the keys of the hash are the variable names preceeded by an underscore.
i.e. the variable
There are around 20 variables in all so I would like to allocate the values in some sort of foreach loop. For example, using 2 variables for simplicity's sake I would like to do something like:
I can see the reasons why this particular code won't work, but can't see how I can fix it! Any help would be appreciated.