in reply to Variable Substitution within NameSpace

$xx="custtype"; print "$R::$xx" ; ## but this prints only "custtype"???
Can anybody tell me what syntax I should use for this to work?

You can do exactly what you want, but it is not a good way for CGI applications.

$xx="custtype"; print eval "\$R::$xx"; $erxx = eval "\$R::$xx"; print "R::xx = $errxx\n";

Replies are listed 'Best First'.
Re^2: Variable Substitution within NameSpace
by yellow_tree_frog (Initiate) on Aug 04, 2004 at 17:43 UTC
    i should have specified i'm working on Windows 2000.
    ccn's solution below worked:
    print eval "\$R::$xx";
    but the soln by SUNADM below only printed ::custtype. Maybe this would have worked on a Unix based OS.

    print "$R" . "::" . "$xx\n";

    I will though take the advice of avoiding using symbolic references in this manner and instead will use the CGI param method.
    Thanks for all the help. ytf