use strict; use warnings; use Linux::Inotify; my $notifier = Linux::Inotify->new(); my $watch = $notifier->add_watch('/directory/to/monitor', Linux::Inotify::CREATE); while (1) { for my $event ($notifier->read()) { print "New file named: " . $event->fullname() . "\n"; } }