From owner-freebsd-questions@FreeBSD.ORG Fri Sep 7 02:22:22 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0DFA16A418 for ; Fri, 7 Sep 2007 02:22:22 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2067513C428 for ; Fri, 7 Sep 2007 02:22:20 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from epia-2.farid-hajji.net (epia-2 [192.168.254.11]) by fw.farid-hajji.net (Postfix) with ESMTP id 900A8DA85A; Fri, 7 Sep 2007 04:24:02 +0200 (CEST) Date: Fri, 7 Sep 2007 04:25:41 +0200 From: cpghost To: Olivier Regnier Message-ID: <20070907042541.354817af@epia-2.farid-hajji.net> In-Reply-To: <46E08E3B.7050407@oregnier.net> References: <46E08E3B.7050407@oregnier.net> Organization: Cordula's Web X-Mailer: Claws Mail 2.10.0 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: CGI with html X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2007 02:22:22 -0000 On Fri, 07 Sep 2007 01:33:15 +0200 Olivier Regnier wrote: > # MODULES > use CGI qw(:standard); >=20 > # HTML PAGE > print header, > start_html ( > -title =3D> '403, Interdit', > -style =3D> {-code =3D> $style }, > ), > end_html; [snip] > # ------------------------------------ > and here is the result in html: > # ------------------------------------ >=20 > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > xml:lang=3D"en-US"> [snip] > I would like to have this dtd: > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > and this meta code, content=3D"text/html; charset=3Diso-8859-1" /> is not at the good place. > Logically he is before CSS style. >=20 > Can you help me please ? Sorry for my english. Uhhh... it's a long time since I've used CGI.pm. But if I remember correctly, the DTD was hard-coded in CGI.pm itself, and output by start_html(); but you could override it with a value of your own. =46rom /usr/local/lib/perl5/5.8.8/CGI.pm: --------------------------------------- use constant XHTML_DTD =3D> ['-//W3C//DTD XHTML 1.0 Transitional//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd']; ... (And further down) ... # >>>>> Here are some globals that you might want to adjust <<<<<< sub initialize_globals { # Set this to 1 to enable copious autoloader debugging messages $AUTOLOAD_DEBUG =3D 0; # Set this to 1 to generate XTML-compatible output $XHTML =3D 1; # Change this to the preferred DTD to print in start_html() # or use default_dtd('text of DTD to use'); $DEFAULT_DTD =3D [ '-//W3C//DTD HTML 4.01 Transitional//EN', 'http://www.w3.org/TR/html4/loose.dtd' ] ; ... (scroll down again) ... #### Method: start_html # Canned HTML header # # Parameters: # $title -> (optional) The title for this HTML document (-title) # $author -> (optional) e-mail address of the author (-author) # $base -> (optional) if set to true, will enter the BASE address of this document # for resolving relative references (-base)=20 # $xbase -> (optional) alternative base at some remote location (-xbase) # $target -> (optional) target window to load all links into (-target) # $script -> (option) Javascript code (-script) # $no_script -> (option) Javascript