in reply to Dynamic package name (?!)

perlmod explains symbol tables. Without testing, I think %::{"sy::"}{$packagename . '::} should give you the symbol table, in which you can lookup the variable.

Replies are listed 'Best First'.
Re^2: Dynamic package name (?!)
by me_like_perl (Initiate) on Feb 07, 2011 at 15:15 UTC
    I had a look on perlmod allready but unfortunatly i could not find something that even pointed in the right direction. I dont have problems with variable "Variable" names (even if u should not use them i know ;) but that variable package name syntax makes me barf :-P

    P.S.: %::{"sy::"}{$packagename . '::}

    just spits out tons of errors ending with :

    syntax error at ./sy.x line 699, near "}{" syntax error at ./sy.x line 702, near "}" syntax error at ./sy.x line 714, near "}" syntax error at ./sy.x line 730, near "}" Execution of ./sy.x aborted due to compilation errors.
      Sorry, the main symbol table is %::, but when accessing elements it needs to become a $. And of course the final quote needs to be finished too, so more like:
      $::{"sy::"}{$packagename . "::"}