When you run the script from a normal prompt, you're running it as your normal user account, not www. So I would think that it's still the sudo requiring password issue. Either run the script from the command line using sudo -u www (something like: sudo -u www perl /path/to/perl/script.cgi) or add your normal account to the sudoers file.
system `/usr/local/www/cgi-bin/ntop/ntop.sh stop` or die "cannot stop
+ntop: $!";
sleep(8);
$cc = `sudo /usr/local/www/cgi-bin/ntop/ntop.sh start` or die "cannot
+start ntop: $!";
print "status:</font> ",$cc,"\n";
You're still using backticks. You know, the little ` ` marks? And now you're using backticks and then calling system() with the RESULTS of the backticks. Er, hello?!
my $val = system("/usr/local/www/cgi-bin/ntop/ntop.sh stop");
die "command got results of $val" if $val != 0;
Use regular strings to describe your command, and give that as an argument to the system() function. That runs a command. It returns a NUMBER result, such as 0 for success. As mentioned before, backticks returns a STRING of the program's output, which is a silly way to check for basic success in most cases.