in reply to system commands in os x apache

You're executing your script as a CGI script, but you don't follow the CGI protocol. You need to print out a CGI header. Look at CGI's docs for "header".

Also,
system(`mkdir /cgi-bin/NEW`);
should be
system('mkdir /cgi-bin/NEW');
or just
mkdir('/cgi-bin/NEW');

Your version executes mkdir, captures its output, then executes the output.

Replies are listed 'Best First'.
Re^2: system commands in os x apache
by almut (Canon) on Mar 11, 2010 at 17:22 UTC
    mkdir('/cgi-bin/NEW');

    Also, the path /cgi-bin/NEW looks suspicious, as it would either try to create a directory in the filesystem's root directory / (where the webserver user typically has no permission to write), or in /cgi-bin, which probably doesn't exist. And in case there is no /cgi-bin, Perl's mkdir would also need to create two nested directories in one go, which it generally doesn't.

    Maybe the OP rather simply wants something like 'NEW' (assuming the current directory of the CGI script is the cgi-bin directory (not unlikely)).  Otherwise, the absolute physical path to the web-account's cgi-bin in the filesystem would likely be more appropriate.