i've created a module, part of which creates the beginning of a web
page.  the module overall works fine.  the sub in question even works
fine, except for one point.  here's the sub in the module:

sub html_start
{
        my      %options = @_;
        #       $options{title} = page title
        
        my      $page_start = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 
Strict//EN\"
        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";>

<html xmlns=\"http://www.w3.org/1999/xhtml\"; lang=\"en\" xml:lang=\"en\">

        <head>
                <title>$options{title}</title>
                <link href=\"/css/style1.css\" rel=\"stylesheet\" 
type=\"text/css\" />
        </head>
";
        return($page_start);
}       #       end of  sub html_start

below is the code fragment calling the sub:
######
my      $page_start = &html_start(title => "Privacy");

print "
$page_start
        <head>
        </head>
        
.
.
.
</html>
######

notice the additional empty <head> tags.  this works fine and gives
"Privacy" and the page title.  removing those tags causes the page
code to be printed out when retrieving the page.  my question:

why do the <head> tags in the sub work and the page display perfectly
with the additional empty <head> tags, yet only print out the code as
ascii output when i remove the 2nd set of <head> tags?  why are the
<head> tags in the sub not considered legitimate html code when the
<head> structures are identical in both the sub and the main code?

thanks,
joe
-- 
since this is a gmail account, please verify the mailing list is
included in the reply to addresses

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to