sub handler { shift; # ignore 1st arg (package name) my $q = shift; ... # do what ever runmode requires # return html output }