The only real difference between a CGI script and "not_a_cgi.pl" is that the former prints its results back to the browser along with a content-type header. If you are going to access the script via a regular HTML form submit, you need it to print something back, even if that something is just the same form getting redisplayed. If you use AJAX, you can make it so that the checkbox fires off a call to the script without submitting the form or refreshing the page and therefore the not_a_cgi.pl will work fine since it isn't expected to print a content-type header or anything else to the browser. You could also make a little CGI wrapper that calls the not_a_cgi.pl scripts and redisplays the form on success and displays an error message on failure.