I think I have found a way to do what I need to do but it is complex. I can run Perl based CGI's in a wrapper so that it is run under my account instead of the shell.
Main problem now is that I know nothing about Perl.
Basically part of what I am doing is using a form to edit a file (it is commenting system to go with a simple image gallery I am working on) but if that file doesn't exist it has to create a new file and when it creates it it is with the user set as nobody which is causing me troubles when I try to move, edit, or delete the file later on through a shell or FTP.
What I want to do is when the user submits the form it calls a PHP script which first checks to see if the file exists. If it does it goes on and edits the file the way I already have it set to. If the file doesn't exist it calls on a Perl CGI to create the file and set the correct privs and then the PHP scripts opens and edits this new file.
Can this be done just by doing something like:
exec('perl path.to.cgi $pathtodirectory');
Of course I don't know any Perl so I will have to figure that part out as well. From what I have seen so far I guess I would need to read the STDIN in order to get the varible I passed to it right?