The sudoers file allows you to specify that certain commands can be run by specific users as other users without a password. Scan its documentation for NOPASSWD for the syntax (unfortunately without any examples, nor do I have one handy).
This combines the advantages of the two solutions that you list.
In reply to Re: Running Perl program w/root privs via cron
by Anonymous Monk
in thread Running Perl program w/root privs via cron
by virtualsue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |