in reply to Perl Bug in Regex Code Block?
... specifically, the my. When you use my, you are creating a variable which will disappear when it goes out of scope. since the for (0..2) {} loop is the current scope, when it completes, @counts is destroyed. This is fixed by not using a my inside of the for loop (as you have seen), and is a very perlish thing.my @counts = (0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re2: Perl Bug in Regex Code Block?
by Hofmator (Curate) on Sep 03, 2001 at 16:59 UTC |