in reply to Premature end of script error

It would have been helpful if you had told us which line was line 26, rather than making me count them.

The error means just what it says : that a variable you are using in an eq comparison has not been initialised, ie it is undefined. Have a look at perldiag for an explanation of this warning.

I am guessing that that variable is $action.

You could change your param sub to always return a defined value. For instance:

sub param { my $key = shift; my $value = ....code to get value...; return defined $value ? $value : ''; }

Update

As blazar pointed out below, param() is from CGI, so you could do the following:
sub get_defined_param { my $value = param(@_); return defined $value ? $value : ''; }
and replace all your call's to param() as follows:
my $title = get_defined_param('title'); my $request = get_defined_param('request'); my $orderlist = get_defined_param('orderlist'); my $remark = get_defined_param('remark'); my $host = get_defined_param('host'); my $date = get_defined_param('date'); my $action = get_defined_param('action'); my $gamefile = get_defined_param('gamefile'); my $gamename = get_defined_param('gamename'); my $gamedesc = get_defined_param('gamedesc'); my $counter = get_defined_param('counter');

Replies are listed 'Best First'.
Re^2: Premature end of script error
by blazar (Canon) on May 25, 2007 at 11:58 UTC
    You could change your param sub to always return a defined value. For instance:

    It's not his param sub, it's CGI.pm's. Granted, he may write a wrapper around it, but he'd better take care of undefined values where they may matter.

    A reply falls below the community's threshold of quality. You may see it by logging in.