use Win32::ChangeNotify; my $dir = "c:/some/dir/name"; $notify = Win32::ChangeNotify->new($indir, 0, FILE_NAME); while (1) { $notify->wait or warn "Problem waiting: $!\n"; # Will now wait to execute following code # until a file event happens in $dir # ...stuff ... $notify->reset; } $notify->close;