Re: What are the problems with my CGI script

2006-06-06 Thread Anthony Ettinger
my $name = param('name') || ''; if(defined $name) { # if its valid , HTMLescape it and print it # otherwise tell them they did bad :) } else { # ask them for theri name } definitely the better way to handle it, although you don't need the || unless you want a default value.

Re: What are the problems with my CGI script

2006-06-06 Thread JupiterHost.Net
Anthony Ettinger wrote: my $name = param('name') || ''; if(defined $name) { # if its valid , HTMLescape it and print it # otherwise tell them they did bad :) } else { # ask them for theri name } definitely the better way to handle it, although you don't need the || unles

Re: What are the problems with my CGI script

2006-06-06 Thread JupiterHost.Net
Hello, Use of uninitialized value in concatenation (.) or string at cgi_7.pl line 31. This is your name Use of uninitialized value in concatenation (.) or string at cgi_7.pl line 35. Line 31 and 35 are using data that in uninitialized. For instance calling param() on a parameter that has not

RE: What are the problems with my CGI script

2006-06-06 Thread Smith, Derek
>Dear Dr. Ruud, > >Thanks it works. I change this line into: > >my $name = ($query_obj->param('text_field') or ' '); >But I am not sure why I need to add the (or ''). I >see nowhere in CGI.pm talking about it. Can you >explain it in a liitle bit detail? Also what am I >supposed to do if

Re: What are the problems with my CGI script

2006-06-06 Thread chen li
--- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > chen li schreef: > > > my $name=$query_obj->param('text_field'); > > print $query_obj->p,"This is your name $name", > > "\n\n"; #line31 > > [...] > > Use of uninitialized value in concatenation (.) or > > string at cgi_7.pl line 31. > >my $name

Re: What are the problems with my CGI script

2006-06-06 Thread Dr.Ruud
chen li schreef: > my $name=$query_obj->param('text_field'); > print $query_obj->p,"This is your name $name", > "\n\n"; #line31 > [...] > Use of uninitialized value in concatenation (.) or > string at cgi_7.pl line 31. my $name = ($query_obj->param('text_field') or 'Joe?'); -- Affijn, Ruu

RE: What are the problems with my CGI script

2006-06-05 Thread Charles K. Clarkson
chen li wrote: : I just try a small CGI script. Although it displays no : problem on the webpage there are two small errors in : the script. I wonder if anyone here can help me figure : out. [snip helpful code] : my $name=$query_obj->param('text_field'); : print $query_obj->p,"This is your name