#!/usr/bin/perl use strict; use warnings; # CGI headers (note two newlines, one for a blank line) print "Content-type: text/html\n\n"; # Now anything else you do is HTML ... print "
\n"; print "##
# CGI headers (note two newlines, one for a blank line)
print "Content-type: text/html\n\n";
# Another way to format HTML
my $text = qq{
:
:
: Hello world! 1>
:
:
};
output($text);
# Subroutines
sub output {
my ($text) = @_;
# Reformat the HTML text (remove leading colons ':')
$text =~ s/(^\s+:)|((?<=\n)\s+:)|(\s+$)//g;
# And output it
print $text;
}