in reply to My globals are visable; but undef'ed
You probably want to use our $varname instead, if you really want package variables. See also my our and possibly local (but note that local doesn't do what you might think).
Update: the reason you can "see" the globals using $main::varname is that specifying an explicit package name refers to the package variable whether it's been declared or not. In other words, you're referring to $main::varname, but your lexical $varname isn't the same variable; it just has the same name (but it's not bound to the main package).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: My globals are visable; but undef'ed
by BrowserUk (Patriarch) on Jul 31, 2008 at 22:15 UTC | |
|
Re^2: My globals are visable; but undef'ed
by tilly (Archbishop) on Jul 31, 2008 at 19:26 UTC | |
by Joost (Canon) on Jul 31, 2008 at 20:05 UTC | |
by tilly (Archbishop) on Jul 31, 2008 at 21:30 UTC | |
by Joost (Canon) on Jul 31, 2008 at 21:37 UTC | |
by tilly (Archbishop) on Jul 31, 2008 at 21:51 UTC | |
|