#!/usr/bin/perl use strict; use CGI; my $q = new CGI; my $wait = $q->param("sleep"); if($wait !~/^[0-3]$/){ $wait = 0; } sleep $wait; print qq{Content-Type: text/javascript\n\n}; print qq{callback("hello $wait")};