On Tue, Apr 20, 2004 at 12:00:15AM +0100, Andy Mortimer wrote:
> Zefram writes:
> > After they've fired, they still exist and can be modified and retriggered.
> > See the "again" method.  You need to explicitly cancel your watchers.
> 
> Yep, that works, thanks muchly!
> 
> I'm still slightly puzzled, although since I have a workaround this is
> mostly out of curiosity! ;-)  Since I haven't kept a reference to the
> watchers, I can't see that I could call the ->again method on them to
> re-trigger them anyway (at least, without calling all_watchers and
> breaking it down by desc/type/etc).  Is this Just How It Is, Son, or am I
> missing a trick which having them stay in alive like this would allow?

It was decided that event watchers shall not obey normal variable
scoping rules.  Why?  Because sometimes perl, as an optimization,
keeps references to variables for an unpredictable amount of time.
This clashes with the programmer's need to manage watcher lifecycles
precisely.

(At least I think this was the reason.)

-- 
A new cognitive theory of emotion, http://openheartlogic.org

Attachment: signature.asc
Description: Digital signature

Reply via email to