#!/usr/bin/perl use strict; use warnings; use CGI; require 'myroutines.pl'; # other required routines here ... ... my $cgi = new CGI; my $JSCRIPT=<header(); print $cgi->start_html(-Title=>'myTitle', -script=>$JSCRIPT); ## code here ## if( $cgi->param('submit') { my $output1 = & subRoutine1(arg1,arg2..); ... ... my $output2 = & subRoutine2(arg1,arg2,arg3..); ... ... ### I've used several subroutines ### showing the output to the user } else { ### code to show form fields the user has to fill in } print $cgi->end_html;