Integration with HTML::Mason 

<%perl>
    my $html = slurp_in_template();
    my($wrap_top, $wrap_bottom) = split("CONTENT", $html);

    my $css_tags = $component->scall_method('css_tags');
    my $js_tags  = $component->scall_method('js_tags');

    $wrap_top =~ s{(?=</head)}{$css_tags\n$js_tags}i;

    return($wrap_top, $wrap_bottom);
</%perl>\