AFAIK, cron's smallest time unit is a minute. I wouldn't advise invoking running your perl program every second - this will start a new perl process and compile the script every execution, which is going to be horribly inefficient.
It would be much better to have a loop inside your script which does whatever it is you want to do, then sleeps for a second. For example:
Code:
#!/usr/bin/perl -w
use strict
while (1) {
do_stuff();
sleep 1;
}
sub do_stuff {
...
}
If you're worried about such a program getting killed, you could have a cron job which tests if the program is running and re-launches it if necessary, or, if you have root access, have a respawn entry in your inittab file. Be
very careful when putting stuff in inittab. You can make your system un-bootable if you mess this up.