in reply to Perl header to serve up a .HTML file from a CGI directory

No need to use all that HTML::Template nonsense :) And you're loading stuff you don't need from CGI.pm.

#!Perl -w use strict; use CGI qw(header); print header; print while <DATA>; __DATA__

But anyway, you probably want to arrange your web site so you don't need to serve static content from the cgi-bin directory.

Replies are listed 'Best First'.
Re^2: Perl header to serve up a .HTML file from a CGI directory
by ambrus (Abbot) on Mar 18, 2007 at 15:36 UTC

    No need to load all that perl nonsense. I'm using this:

    #!/usr/bin/tail -n+2 Content-Type: text/plain; charset=ISO-8859-2
    Replacing the content type with the approperiate one of course (I'm using this with a PNG file too).
Re^2: Perl header to serve up a .HTML file from a CGI directory
by GrandFather (Saint) on Mar 13, 2007 at 10:17 UTC

    Or even better:

    #!Perl -w use strict; use CGI qw(header); print header (), <DATA>; __DATA__

    DWIM is Perl's answer to Gödel