Answers

Question and Answer:

  Home  Perl Programming

⟩ 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.

 242 views

More Questions for you: