Thread Perl auf SAT-Receiver (9 answers)
Opened by eriche at 2007-12-10 19:56

eriche
 2007-12-12 19:55
#103801 #103801
User since
2007-12-10
3 Artikel
BenutzerIn
[default_avatar]
JEA das Testscript funkt schon mal!

JEDOCH läuft das ganze bei folgenden Script nicht :(

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/hdd/opt/perl/bin/perl -w
# test.pl v6.01.18
# (c)2002-2006 Cusimano.Com Corporation, all rights reserved

$www = $ENV{'SERVER_PORT'} ne "";
eval "use Compress::Zlib"; $hasCompress = $@ ? 0 : 1;
eval "use LWP"; $hasLWP = $@ ? 0 : 1;
eval "use LWP::Simple"; $hasLWPsimple = $@ ? 0 : 1;
if ($hasLWPsimple) {
eval "use LWP::UserAgent";
my $ua = LWP::UserAgent->new(timeout => 30);
$u = "http://www.c3scripts.com/test/test.txt";
$resp = $ua->request(HTTP::Request->new('GET', $u));
$okLWP = $resp->content =~ /test\.pl/i;
}
eval "use CGI::Carp qw(fatalsToBrowser)"; $hasCGI = $@ ? 0 : 1;
$w = 20; $f = "<b>%" . $w . "s</b> : %s\n"; $f2 = " " x $w . " & %s\n";
print "Content-type: text/html\n\n<html><body><pre>" if ($www);
printf $f, "test.pl", "v6.01.18";
printf $f, "Perl", "v$]";
printf $f, "CGI::Carp", ($hasCGI? "" : "not ") . "installed";
printf $f, "Compress::Zlib", ($hasCompress? "" : "not ") . "installed";
printf $f, "LWP", ($hasLWP? "v$LWP::VERSION " : "not ") . "installed";
printf $f, "LWP::Simple", ($hasLWPsimple? "" : "not ") . "installed";
printf $f, "LWP::Simple", "rx " . ($okLWP? "" : "not ") . "ok" if ($hasLWPsimple);
printf $f, "\@INC", $INC[0]; foreach $x (1..$#INC) { printf $f2, $INC[$x];}
foreach $x (sort keys %ENV)
{ printf $f, $x, $ENV{$x} }
print "</pre></body></html>\n" if ($www);
1;


ich erhalte folgenden Fehler

Code: (dl )
1
2
3
4
5
6
7
8
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, you@your.address and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.0.44 (Unix) PHP/4.3.0 Server at 192.168.1.88 Port 8080


führe ich das Script über die Commandline aus funkt es jedoch!
Was kann da der Apache haben?

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
root@dm7020:/media/hdd/opt/perl/bin> perl /hdd/opt/httpd/htdocs/test.pl
Use of uninitialized value in string ne at /hdd/opt/httpd/htdocs/test.pl line 5.
<b> test.pl</b> : v6.01.18
<b> Perl</b> : v5.008
<b> CGI::Carp</b> : installed
<b> Compress::Zlib</b> : not installed
<b> LWP</b> : not installed
<b> LWP::Simple</b> : not installed
<b> @INC</b> : /hdd/opt/perl/lib/5.8.0/ppc-linux
& /hdd/opt/perl/lib/5.8.0
& /hdd/opt/perl/lib/site_perl/5.8.0/ppc-linux
& /hdd/opt/perl/lib/site_perl/5.8.0
& /hdd/opt/perl/lib/site_perl
& .
<b> EDITOR</b> : /bin/vi
<b> HOME</b> : /home/root
<b> LOGNAME</b> : root
<b> OLDPWD</b> : /hdd/opt/perl
<b> PATH</b> : /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/
sbin:/sbin:
<b> PS1</b> : \u@\h:\w\>
<b> PWD</b> : /hdd/opt/perl/bin
<b> SHELL</b> : /bin/sh
<b> TERM</b> : xterm-color
<b> USER</b> : root
root@dm7020:/media/hdd/opt/perl/bin>



DAS ERRORLOG vom Apache sagt folgendes:

[Wed Dec 12 17:54:26 2007] [error] [client 192.168.1.2] Premature end of script headers: test.pl

bitte um HILFE

Gruß Erich

View full thread Perl auf SAT-Receiver