in reply to Re^2: Variable name
in thread Variable name

Like I said: "Use of uninitialized value in print"

Sorry, but where exactly did you say that?

Hi all

I am trying to concatenate a string and a value of a variable to construct the name of a known variable.

For example:

$foo="foo"; $bar="f"; print ${$bar.'oo'}

should give out: "foo" but it doesn't.

Now, before you say anything, yes, I know, I should use a hash instead, but humor me, would you ?

Thanks

Noam


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^4: Variable name
by MidLifeXis (Monsignor) on Dec 08, 2008 at 15:40 UTC

    In the OP's defense, it was in response to me after you replied to their original posting. Just a race condition and small bout of carelessness on the OP's part.

    --MidLifeXis