in reply to
Re^2: understanding closures
in thread
understanding closures
They are sharing the same lexical. What confuses you is the fact that you are doing post-increment. The result of
$count++
is the
old
value of
$count
. Change that line to
++$count
, and try again.
Comment on
Re^3: understanding closures
Replies are listed 'Best First'.
Re^4: understanding closures
by
reasonablekeith
(Deacon)
on Sep 26, 2005 at 08:08 UTC
Yup, you're right. I was too busy wondering about closures to spot that one. Not that this is an excuse. :(
Thanks everyone.
---
my name's not Keith, and I'm not reasonable.
[reply]
In Section
Seekers of Perl Wisdom