in reply to modifying a line in a file with some restrictions

sysopen(TOPIC, "$root/content/topics/$get{'topic'}", O_WRONLY);
That is almost certainly a broken CGI script I see there. Please do yourself the favour and read Ovid's excellent CGI course, there are many security and safety issues to consider.

Makeshifts last the longest.