Two things came to mind when I read your post. First, it seems to me that there is file-sharing problem. If you're on Windows, then make sure that the files that you want to share are set up for file-sharing. Second, it seems to me that you're really trying to emulate a "service". You can set up a perl script to work as a sevice using Win32::Daemon and Win32::Daemon::Simple. See:
Win32::Daemon
Win32-Daemon-Simple