You can insert a title, as well as many other attributes to the "head" section through the use of a hash reference:
-
#!/usr/bin/perl -T
-
-
# Use -T if you are going to be allowing users to submit text.
-
# another great tool is the "fatals to browser"
-
-
use CGI:Carp qw(fatalsToBrowser warningsToBrowser);
-
use CGI qw(:standard);
-
use strict;
-
use warnings;
-
-
print header;
-
print start_html(-title=>'Whatever title you want',
-
script=>{'src'=>'URL to src of javascript'},
-
style=>{'src'=>'source of style sheet'});
-
-
The result would be:
[HTML]
Content type
<doctype definition>
<meta char-set def>
<head>
<title>Whatever title you want</title>
<script type="text/javascript" src="source to javascript file"></script>
<link rel="stylesheet" href="source to stylesheet">
</head>
<body>
[/HTML]
Read more here
How you can capture the first line of the page, and insert it into the title, would have to do with setting a scalar, and substituting it in the start_html function call.
Exactly how is up to you...