By default you can NOT run scripts as setuid on many new Linux distro’s..
Use a small C-wrapper to circumvent this:
#define REAL_PATH "/usr/local/scripts/myscript.pl" main(ac, av) char **av; { execv(REAL_PATH, av); }
Compile and set uid on the executable and your script (/usr/local/scripts/myscript.pl) will run setuid 🙂