sub show_form { my $c = shift ; my $status = status() ; my $message = get_message() ; my $page ; my %subst = ( _SERVICE_NAME_ => $service_name, _MESSAGE_ => $message, _STATUS_ => $status ) ; my $th = IO::File->new ; die "FATAL: Cannot open template file $template: $!" unless $th->open($template,'r') ; foreach my $line ($th->getlines) { $line =~ s/(_[A-Z_]+_)/$subst{$1}/g ; $page .= $line ; } $th->close ; reset_message ; my $resp = HTTP::Response->new ; $resp->content($page) ; $c->send_response($resp) ; }