nagalenoj has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; package new; $new::variable = 1; $another_variable = 2; 1;
When I right a code like this, I get error for not declaring $another_variable and there is no error for not declaring $variable. Why is so?
I thought, it will raise error for both cases. Someone please explain, how both are different.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Variable declaration
by GrandFather (Saint) on Oct 14, 2011 at 06:33 UTC | |
by Eliya (Vicar) on Oct 14, 2011 at 07:14 UTC | |
|
Re: Variable declaration
by fisher (Priest) on Oct 14, 2011 at 06:10 UTC | |
|
Re: Variable declaration
by Anonymous Monk on Oct 14, 2011 at 06:11 UTC | |
by Anonymous Monk on Oct 14, 2011 at 06:13 UTC | |
|
Re: Variable declaration
by Ovid (Cardinal) on Oct 17, 2011 at 15:14 UTC |