in reply to Value of a scalar specified by a second scalar

You can't do it with lexical (my) variables. Symbolic references only work with variables that reside in the symbol table (which lexicals don't). Here's an example:

( $a, $b, $c ) = ( 10, 20, 30 ); $want = 'a'; print $$want, "\n";

In your eample, you're treating lexicals as if they have symbolic entries in the global symbol table. They just don't. So when you print *{$want}, you're not actually accessing the lexical, $client.


Dave

Replies are listed 'Best First'.
Re^2: Value of a scalar specified by a second scalar
by bangers (Pilgrim) on May 17, 2006 at 17:49 UTC
    Ah. simple when you know how. I had tried $$want, but as I always use lexical variables is hadn't worked. Thanks