Hallo
*From: "Helga Fischer"
Wie ist denn Dein System eingerichtet?
Suse Linux 7.3 Apache 1.3.27, perl 5.6.1
Der einzige ScriptAlias /cgi-bin/ "/usr/local/httpd/cgi-bin/"
Sonstige Einträge für CGI
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
AllowOverride None
Options +ExecCGI -Includes
SetHandler cgi-script
</Location>
AddHandler cgi-script .cgi
<IfModule mod_perl.c>
SetHandler perl-script
PerlHandler Apache::Status
order deny,allow
deny from all
allow from localhost
</Location>
#VirtualHost Eintrag
ServerAdmin siefke@linux.siefke.ll
DocumentRoot /home/siefke
ServerName siefke.linux.siefke.ll
ErrorLog /var/log/httpd/siefke-error_log
CustomLog /var/log/httpd/siefke-access_log common
Options ExecCGI
SetHandler cgi-script
</Directory>
</VirtualHost>
Script Beispiel
#!/usr/bin/perl
use CGI;
require "get_help_function.cgi";
# template file
my $templateFile = "../htdocs/template/information/information_de.html";
# Umgebungsvariablen ausgeben
printoutValues();
exit();
sub printoutValues {
my $out;
my $value;
my $line;
my $max_row=40;
my $css_class="cell2";
my $row_no=4;
my ($template, $row) = loadTemplate($templateFile, 'INFO');
my @ENVSort = sort (keys %ENV);
foreach $key (@ENVSort)
{
$value = $ENV{$key};
$line = $row;
$row_no++;
$css_class = ($css_class eq "cell1") ? "cell2": "cell1";
my $l = length($value);
my $p = 0;
my $va = "";
if ($l>$max_row)
{
while ($l>$max_row)
{
$va .= substr($value, $p, $max_row);
$va .= '<br />';
$p = $p + $max_row;
$l = $l - $max_row;
}
$va .= substr($value, $p);
}
else
{
$va = $value;
}
$line =~ s/\[CSS_CLASS\]/$css_class/ig ;
$line =~ s/\[NR\]/$row_no/ig ;
$line =~ s/\[KEY\]/$key/ig ;
$line =~ s/\[VALUE\]/$va/ig ;
$out .= $line;
}
$template = replaceTemplateArea($template, 'INFO', $out);
print "Content-Type: text/html\n\n" ;
print $template;
}
Gruß Silvio