http://www.perlmonks.org?node_id=450488

willyyam has asked for the wisdom of the Perl Monks concerning the following question:

What I am trying to do may be stupid/daft/wrong-headed; any alternate methods would be appreciated.

I wanted to put a variable name together dynamically inside a sub, based on the arguments of that sub. For instance, if the first argument is "example" and the second is "other", I wanted to define a variable called $exampleother1, or $exampleother2. I can concatenate variables and strings, but I don't know how to concatenate a string and then make it a variable name.

Because this seems hard/strange I suspect that it is also idiotic, but I think I'm better off asking for the wisdom (and tolerance) of the monks then to sit in ignorance.

Update: Yep, stupid, daft and wrong-headed. Using a data structure to capture my cases makes more sense then trying to build case-specific variables. I should stop asking questions and just re-read the Llama book each time I find something difficult. Thanks for the suggestions, guidance and references.