I have a script that runs as a service, and relies on Win32::ChangeNotify. However, the second time through my master while loop the creation of the Win32::ChangeNotify object fails and doesn't set "$!". I've tried calling reset(), close() & undef'ing my notify object but it doesn't seem to help. <..snip... - lies inside of a larger infinite while loop..> my $notify = Win32::ChangeNotify->new($INDIR, 0, 'FILE_NAME') or die "Can't create ChangeNotify object: $!"; my $status; while (1) { $status = $notify->wait or warn "Something changed: $!"; if ($status == 1) { # Don't proceed until the $INDIR is empty my $files_exist = 0; my @files = <$INDIR/*>; foreach my $file (@files) { if (!(-d $file)) { # Only look for files $files_exist = 1; $notify->reset; last; } } if (!$files_exist) { last; } } else { die "A wait error occured: $!"; } } $notify->reset; $notify->close; #undef $notify; ______________________________________ William E. Jens; PagePath Technologies, Inc. (630) 616-0131 ext. 133 Fax: (630) 616-0440 <mailto:[EMAIL PROTECTED]> <http://www.pagepath.com/> --- You are currently subscribed to perl-win32-users as: [archive@jab.org] To unsubscribe, forward this message to [EMAIL PROTECTED] For non-automated Mailing List support, send email to [EMAIL PROTECTED]