Your solution is sudo !
(I tend to use it instead of suidperl)
Whatever the language you use for your prog (shell,Perl,C)
You can even allow some users to execute some commands as root without entering root passwd (a LOT safer to my mind).
"Only Bad Coders Code Badly In Perl" (OBC2BIP)
Re: Executing Root Commands from user level