in reply to Perl Bug in Regex Code Block?
I may be confussed, but i think the problem is with the :
can't sleep clowns will eat me
-- MZSanford
... 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);
can't sleep clowns will eat me
-- MZSanford
|
---|
Replies are listed 'Best First'. | |
---|---|
Re2: Perl Bug in Regex Code Block?
by Hofmator (Curate) on Sep 03, 2001 at 16:59 UTC |
In Section
Seekers of Perl Wisdom