in reply to Re^2: Unforgettable Closures?
in thread Unforgettable Closures?
No, you don't need a newer version of Perl (it wouldn't help you, for several reasons1).
You need to change your code that looks like:
my $var= ... if ...;
to instead look like
my $var; $var= ... if ...;
You don't want to skip the run-time effect "my" when your conditional is false. That run-time effect is what resets your variable so that you don't get a previous value.
- tye
1 A) The newer version just adds warning; it doesn't change how anything works. B) The warning doesn't even apply to what you've done; it appears this new warning is pretty stupid, in fact. C) Just fix your code and it works fine on old versions of Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Unforgettable Closures? (shave)
by faiz (Acolyte) on Dec 10, 2007 at 04:58 UTC | |
by ikegami (Patriarch) on Dec 10, 2007 at 05:59 UTC | |
by faiz (Acolyte) on Dec 10, 2007 at 07:27 UTC | |
by tye (Sage) on Dec 10, 2007 at 05:52 UTC |