$|=1; use Win32::RASE; eval "use Time::HiRes qw(sleep)"; $hrasconn = (RasEnumConnections())[1]; $old_status = -1; while ( ($status, $status_text) = RasGetConnectStatus($hrasconn) ) { if ($status != $old_status) { print "$status: $status_text\n"; $old_status = $status; } sleep ($@ ? 1 : 0.01); } # error 6 - Invalid handle ($err = Win32::RASE::GetLastError) != 6 and die Win32::RASE::FormatMessage($err); exit;
The above code goes into a while loop and constantly checks for the internet connection and prints connected or disconnected as appropriate Now my question is how do I use this loop in Win32 GUI suppose I use the above loop as it is control , will NOT be transferred to any other part of the program... I know that Win32::GUI::Dialog(); actually goes into an indefinite loop looking for keypresses etc How can I integrate the while loop also into theWin32::GUI::Dialog(); loop ? hope Im clear with my question if NOT I will elaborate Thanks chris www.perl-resume.com