See INotify, Dir::Watch, File::ChangeNotify.
For examples, see the linked modules.
In reply to Re: Automation with Perl by Corion in thread Automation with Perl by Zanooda