in reply to Any event modules that support STDIN polling for Windows?

Glib works on Windows. Try this:
#!/usr/bin/perl use warnings; use strict; use Glib; my $main_loop = Glib::MainLoop->new; Glib::IO->add_watch (fileno 'STDIN', [qw/in/], \&watch_callback, 'STDI +N'); #just to show it's non blocking my $timer1 = Glib::Timeout->add (1000, \&testcallback, undef, 1 ); $main_loop->run; sub watch_callback { # print "@_\n"; my ($fd, $condition, $fh) = @_; my $line = readline STDIN; print $line; #always return TRUE to continue the callback return 1; } sub testcallback{ print "\t\t\t".time."\n"; } __END__

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: Any event modules that support STDIN polling for Windows?
by KHLeow (Novice) on Aug 30, 2010 at 08:44 UTC

    After installing ExtUtils::Depends, ExtUtils::PkgConfig and Glib, I ran the code but was greeted with an error popup like this:

    The procedure entry point g_initially_unowned_get_type could not be located in the dynamic link library libgobject-2.0-0.dll.

      It sounds like you have a version mismatch between the glib dll you have, and the Perl module.... its a common problem installing c-based modules on win32. If you want an easy way to get it going, put in Camelbox: A build of Gtk2-Perl for Windows , although that will give you a full Gtk2 install, in addition to the Glib base object library.

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh
        I just found out that I've already had Gtk2 DLLs installed and listed in the Path environment variable. Hence Perl attempted to use those DLLs instead of the ones I've fetched on recommendation by the Perl Package Manager. Since then, I've resolved the conflict and was able to run the piece of code you showed me. However just like most of the other modules that I've tried, it didn't respond to my keypresses.