If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
Perl Questions and Answers
(Continued from previous question...)
If EXPR is an arbitrary expression, what is the
difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
The second is disallowed under `use strict "refs"'.
Dereferencing a string with *{"STR"} is disallowed
under the refs stricture, although *{STR} would not
be. This is similar in spirit to the way ${"STR"}
is always the symbol table variable, while ${STR}
may be the lexical variable. If it's not a
bareword, you're playing with the symbol table
in a particular dynamic fashion.
(Continued on next question...)
Other Interview Questions
|