in reply to Is this a bug in Perl scope?
No. package only declares a new package, it does not end the lexical scope of the previous package. The $var you use after the package main statement is the lexical $var that you declared after the package two; statement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is this a bug in Perl scope?
by Zarabozo (Sexton) on Jul 22, 2012 at 13:53 UTC | |
by Corion (Patriarch) on Jul 22, 2012 at 14:05 UTC | |
by tobyink (Canon) on Jul 22, 2012 at 19:15 UTC | |
by AnomalousMonk (Archbishop) on Jul 22, 2012 at 22:59 UTC | |
by ww (Archbishop) on Jul 23, 2012 at 00:57 UTC |