in reply to dropping from root to lower user

Another way:

use POSIX 'setuid'; setuid ((getpwnam 'www')[2]);

After Compline,
Zaxo