Suggestion for FAQ 7.17
[email protected] (Randall) Mon, 20 Nov 2006 07:44:02 +0000 (GMT)
| Newsgroups | perl.perlfaq.workers |
|---|---|
| Message-ID | <[email protected]> |
FAQ 7.17 How can I access a dynamic variable while a similarly named
lexical is in scope?
There is a third way which isn't mentioned in the FAQ. It bypasses the
need for a package name, and simply looks in the current symbol table.
It's also slightly less confusing than redeclaring the 'our' variable.
print "lexical is $var\n";
print "global is ${*var}\n";
# grab the scalar entry from the 'var' typeglob