in reply to ActivePerl Gtk2::Helper Hangs

Hi Guys,
I found out something that might help. Try this code out.

#!/usr/bin/perl -w use strict; use Gtk2 '-init'; use Gtk2::Helper; use Data::Dumper; use IPC::Open2; use FileHandle; # file handles my $wfh = FileHandle->new(); my $rfh = FileHandle->new(); open2($rfh,$wfh, "C:\\Windows\\System32\\cmd.exe"); my $window = Gtk2::Window->new(); $window->signal_connect("destroy",sub{Gtk2->main_quit();}); $window->set_size_request(200,200); my $vbox = Gtk2::VBox->new(); $window->add($vbox); my $button = Gtk2::Button->new("WRITE"); $button->signal_connect('clicked'=>sub{ write_fh(); }); $vbox->pack_start($button,0,0,0); $button = Gtk2::Button->new("READ"); $button->signal_connect('clicked'=>sub{ read_fh(); }); $vbox->pack_start($button,0,0,0); $window->show_all(); Gtk2->main(); sub write_fh { print $wfh "dir\n"; } sub read_fh { my $buffer; my $resp = sysread($rfh,$buffer,1); if($resp){ if($buffer =~ /\n/){ print "newline\n"; } } print "[$resp]$buffer\n"; }

Run the program and press the read button until it hangs, it always hangs when it encounters the "end of file" but i think its not the end of file because I am reading the output of the command line. I tried using eof($rfh) and it hangs hehehe... Help please

Mabuhay Civil Engineers! :D