in reply to Many strings make one variable?

If $wonderFull is a package variable, you could do:
{ no strict 'refs'; $temp = ${$var1 . $var2}; }
But you don't really want to do that.

The reason I want to do this is that I will have a large cgi script with many predefined open file handles. I want the user to select two values from pull down boxes on a web page and then by using these it will use the correct file handle. It could be done with lots of if statements but there must be a better way to do it?
If that is what you want, why didn't you just ask that? Now your question is of the form "How do I do X, because I want to do Y, and I might be able to do that with X". Better is to ask "How do I do Y?", because the answer is Z. And Z is "Use a hash". In your case, a 2 dimensional hash. The selected values will be the entries, and the filehandles (or rather, references to them), the values.

Abigail

Replies are listed 'Best First'.
Re: Re: Many strings make one variable?
by heezy (Monk) on Oct 14, 2002 at 18:51 UTC

    Thanks to everyone who replied on this issue, you were all a great help!

    M