On 7/27/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >
> ``my'' variables (lexical variables) do not appear in the symbol table at > run time (as do package variables, whether declared or auto-vivified) and so > cannot be referenced ``symbolically''. lexical variables are dealt with > and disposed of by the compiler at compile time. > > btw -- i agree with a previous post that it is better to use a hash and > avoid symbolic references. > > bill walters With symbolic refs you are using a hash -- it;s just hidden in the internals. Anyway the lexical names are not entirely thrown out by the compiler, and there is a way to do symbolic refs against lexicals -- it's eval-string my $database_name = 'cheese'; my $variable_name = 'database_name'; print eval "\$$variable_name" -- David L Nicol "This has been your one free extra mile" _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs