scripting "execute this as user/passwd"
I've got a perl based website running as 'nobody' with the need to execute a privileged command (modify stuff in /home/someuser). As it happens I've got the username and password in the perl environment. The su command would work for me except it doesn't allow the password to be entered in a script. I don't want to allow 'nobody' any permissions via sudo.
In summary, given I'm running as 'nobody' I want to script executing commands as 'someuser' and I have the password for the account for 'somesuser'. What's the recommended approach?