in reply to Re: Event based programming: Callbacks or "Interfaces"?
in thread Event based programming: Callbacks or "Interfaces"?

I understand completely where you are coming from, I read the original discussion about hating on File::Find, but to be honest, I have no freaking idea how I'm supposed to make an iterator interface for this thing.

The code in question is almost certainly going to respond to only one event at a time. The code will probably be eval'd once for each event needful, so it'll never have any access to the "next event". I suppose in rare cases it might handle 2 or 3 events, but I doubt it. This is primarily for security purposes as the code handling the event is going to be untrusted, so I don't want it hanging around for very long.
  • Comment on Re: Re: Event based programming: Callbacks or "Interfaces"?

Replies are listed 'Best First'.
Re: Re: Re: Event based programming: Callbacks or "Interfaces"?
by etcshadow (Priest) on Jun 01, 2004 at 22:46 UTC
    Fair enough... which is why I qualified my statement as "unless there is a really good reason not to".

    But just to throw in one parting jibe: untrusted code is another reason to avoid callbacks. :-)

    Also, for the record: I don't hate File::Find, I just wish that the writers had made a different interface for it. One of the reasons why I was probably so negative about File::Find is that I'm still stuck in 5.005, and the File::Find that came with 5.005 was really hardly any better than rolling your own. It's gotten better since then, though (in terms of performance, features, and cross-platform portability... but not in terms of code sanity or interface design).

    ------------ :Wq Not an editor command: Wq