use CGI;
my $q = new CGI;
open(OUT, '/tmp/out.html') or die "Couldn't open out file: !$";
print OUT $q->header,
$q->start_html('hello world'),
$q->h1('hello world'),
$q->end_html;
close OUT or "Couldn't close out file: $!";
or you can redirect STDOUT in the your file:
use CGI;
my $q = new CGI;
open(SAVE, ">&STDOUT");
open(STDOUT, '/tmp/out.html') or die "Couldn't open out file: !$";
print $q->header,
$q->start_html('hello world'),
$q->h1('hello world'),
$q->end_html;
open(STDOUT, ">&SAVE");
--------------------------------
SV* sv_bless(SV* sv, HV* stash);
|