Courage has asked for the wisdom of the Perl Monks concerning the following question:

Dear all,

two small questions:
1. Is there exists something to read about 'Ev' which is used in Tk?
2. Inside there exists a subroutine 'Ev' which ends with return bless $obj,'Tk::Ev'; However I can not find Tk::Ev module anywhere. Where is it?

Thanks in advance,
Courage, the Cowardly Dog.
PS. Something fishy is going on there, or my name is Vadim Konovalov. And it's not.

Replies are listed 'Best First'.
Re: Tk question about Ev
by ariels (Curate) on Jun 08, 2002 at 13:22 UTC
    See the docs for Tk::bind (part of the Tk distribution), which uses it.
Re: Tk question about Ev
by smackdab (Pilgrim) on Jun 09, 2002 at 03:49 UTC
    Also, Mastering Perl/Tk has a chapter (15) on MainLoop and it is talked about a is a good book

    Wouldn't you know, that is the chapter that O'Reilly gives for free ;-)

    I think this worked out for you ;-)
      Thank you a lot!
      As additional note I want to share my small improvement into module that makes it ~30% faster.
      (Ev is usually used in GUI event callbacks, and it's crucial to write code there which executes as fast as possible)
      sub Ev { if (@_ == 1) { my $arg = $_[0]; return bless (((ref $arg) ? $arg : \$arg), 'Tk::Ev'); } else { return bless [@_],'Tk::Ev'; } }
      I wrote small becnchmark program and can share it and its result as well.

      Courage, the Cowardly Dog.

        You should consider posting it to
        There are some very good Tk people there