On Thu, Feb 03, 2000 at 08:46:16AM -0500, Joshua Pritikin wrote:
> On Wed, Feb 02, 2000 at 10:47:43PM -0500, [EMAIL PROTECTED] wrote:
> >   NI> Ick - you did that too. If I had my time over again I would not 
> >   NI> have done that in Tk - the constructor idea is fine, but 
> >   NI> the implcit require is a pain. In particular you don't discover 
> >   NI> that your app has not been correctly B::* compiled till 
> >   NI> you try and run it and hit the execution pattern that needs the require.
> > 
> > well that can be fixed easily. i am only in development. how many users
> > of event.pm are there? it is classified as beta code as well.
> > 
> > on the other hand, most event watchers are created at startup. so the
> > chances of a long wait before a dynamic load triggers a compile error
> > are slim. and there are a lot fewer of them than tk things to load so it
> > is easier to manage and keep the compiler bugs out.
> 
> Nick, are you satisfied with Uri's comments?  We *can* change Event if
> folks feel strongly about it.  It's not too troublesome to add this to
> my codes:

I don't think it would be too much of an issue if the require was removed
from the AUTOLOAD.
 
>   require $_ for qw(Event::io Event::timer);   # untested

I am sure it is untested, as it will not work :-(

Perl only does the package->file name translation if the
argument to require is constant.

You could consider adding an Event::Type package (ala Tk::widget)
so you can type

  use Event::Type qw(io idle);

Or you could do something with import in Event::Watcher.


Of course you should also consider if Event->io should use AUTOLOAD or
if Event::io should just call a register method to create the sub, thus
doing away with AUTOLOAD all together.

Graham.

Reply via email to