Nik has asked for the wisdom of the Perl Monks concerning the following question:
I have the following code and iam gettign those errors when index.pl trying to pass values to admin.pl and i dont see why.Also what I dont understand 2 things. Why the scripts dies prematurely although 'perl -c admin.pl' finds it syntactically correct and what is this uninitialized value in string that the error is complaining about.
Here is the code, admin.pl is actually a decission making script on what script will be nextly ran depending on index.pl's form values.[Fri May 25 13:06:47 2007] [error] [client 10.0.0.2] Premature end of +script headers: admin.pl, referer: http://dell/ [Fri May 25 13:06:47 2007] [error] [client 10.0.0.2] [Fri May 25 13:06 +:47 2007] admin.pl: Use of uninitialized value in string eq at D:\\ww +w\\cgi-bin\\admin.pl line 26., referer: http://dell/
#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard); use DBI; use POSIX qw(strftime); use Encode; my $title = param('title'); my $request = param('request'); my $orderlist = param('orderlist'); my $remark = param('remark'); my $host = param('host'); my $date = param('date'); my $action = param('action'); my $gamefile = param('gamefile'); my $gamename = param('gamename'); my $gamedesc = param('gamedesc'); my $counter = param('counter'); #========================== REDIRECT TO PROPER SCRIPT ================ +========== if( $action eq 'Παραγγελί +α!' ) { #========================= SHOW USER LIST TO PUBLIC ============== +========== if( $title eq 'show users' ) { print redirect("/cgi-bin/show.pl?action=Παρ^ +5;γγελία!&request=$request"); exit 0; } #================== SHOW USERS THAT HAVE DOWNLOADED FROM VAULT === +========== elsif( $title eq 'show downloads' ) { print redirect("/cgi-bin/show.pl?action=Παρ^ +5;γγελία!&request=$request"); exit 0; } #========================= SAVE USER DATA TO DATABASE============= +========== elsif( defined($title) and defined($request) and defined($orderlis +t) and defined($remark) ) { print redirect("/cgi-bin/show.pl?action=Παρ^ +5;γγελία!&authname=$ENV{REMOTE_USER}&ti +tle=$title&request=$request&orderlist=$orderlist&remark=$remark&host= +$host&date=$date"); exit 0; } else { print redirect("/data/private/") } } #========================== AUTHORIZE USER TO DOWNLOAD =============== +========== print redirect("/cgi-bin/vault.pl?authname=$ENV{REMOTE_USER}&gamename= +$gamename") if( defined($gamename) );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Premature end of script error
by leocharre (Priest) on May 25, 2007 at 10:31 UTC | |
by blazar (Canon) on May 25, 2007 at 11:54 UTC | |
|
Re: Premature end of script error
by clinton (Priest) on May 25, 2007 at 10:33 UTC | |
by blazar (Canon) on May 25, 2007 at 11:58 UTC | |
| |
|
Re: Premature end of script error
by blazar (Canon) on May 25, 2007 at 12:01 UTC |