Ciao a tutti,
buone feste!
Premetto che sono a digiuno di perl con cgi.
ho trovato on line uno script che mi fa comodo per la lettura lato web, FUNZIONA perfettamente, ma vorrei customizzarlo un poco. quando ho fatto delle prove subito notato che l'output che genera è "pasticciato" e non riesco a metterci le mani come vorrei.
inizia così:
codice:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use DBI;
use Socket; # inet_aton
sub webutils_cgiinit($)
{
$CGI::DISABLE_UPLOADS = 1;
$CGI::POST_MAX = 102_400; # 100 KB
$|=1;
my $title = shift;
my $cgi = new CGI;
print <<"_HTML_";
Content-type: text/html
<HTML>
<HEAD>
<TITLE>$title</TITLE>
<META name="robots" content="noindex,nofollow">
<META name="ROBOTS" content="NOINDEX,NOFOLLOW">
<META http-equiv="Content-Language" content="ru">
<META http-equiv="Content-Style-Type" content="text/css">
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
</HEAD>
_HTML_
print $cgi->start_html($title), $cgi->h1($title);
$cgi;
}
l'output del sorgente di pagina e questo:
codice:
<HTML>
<HEAD>
<TITLE>Read</TITLE>
<META name="robots" content="noindex,nofollow">
<META name="ROBOTS" content="NOINDEX,NOFOLLOW">
<META http-equiv="Content-Language" content="ru">
<META http-equiv="Content-Style-Type" content="text/css">
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
</HEAD>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Read</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h1>Read</h1>
io vorrei aggiungere dei css con i meta, ma non me li legge....
ed ottenere un risultato così:
codice:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<HTML>
<HEAD>
<TITLE>Read</TITLE>
<META name="robots" content="noindex,nofollow">
<META name="ROBOTS" content="NOINDEX,NOFOLLOW">
<META http-equiv="Content-Language" content="ru">
<META http-equiv="Content-Style-Type" content="text/css">
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link href="css/css02.css" rel="stylesheet" type="text/css" />
</head>
<body class='bcg1'>
<h1>Read</h1>
il file in analisi è un file ".pm" (pag1.pm) richiamato da una pagina .cgi (pag2.cgi)
potete aiutarmi a capire, sicuramente sono carente di conetti..
Ciao e grazie