in reply to Re^4: Help! My variables are jumping off a cliff!
in thread Help! My variables are jumping off a cliff!
I have also shown that it can be, and usually is, an errorYou haven't. Your OP shows some code, but it's not clear to me whether there's an error. But even I grant you that you have shown that it's possible to make an error, you have utterly failed to even remotely convince me of the "usual" part.
To go back to your original code:
What's the error here? This prints 10. Should this have printed 1? Do note that if you'd had written:my $x = 1; # Variable declaration my $x = 10; # Variable suicide! print $x;
it would have still printed 10.my $x = 1; $x = 10; print $x;
You know, it happens probably a few times a week that my code triggers the "masks declaration" warning. I cannot recall a single time where this was actually causing a problem. Just removing the "my" fixes the problem; or a no warnings 'misc';.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Help! My variables are jumping off a cliff!
by oko1 (Deacon) on Feb 27, 2012 at 00:50 UTC | |
by Your Mother (Archbishop) on Feb 27, 2012 at 01:22 UTC | |
by JavaFan (Canon) on Feb 27, 2012 at 08:45 UTC |