in reply to Re: Re: Re: Re: Warning Messages
in thread Warning Messages

Hi All, I am having real problems sorting out the read( ) line, as it keeps bringing up a unititialized error message - I desperately need to fix this ... is there any way ?

For the $ENV{'QUERY_STRING'} error I enclosed that in a if ($ENV{'QUERY_STRING'}) { <<>> } tag ...Please let me know if there is any way I can fix the read

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Warning Messages
by chromatic (Archbishop) on Nov 19, 2001 at 23:33 UTC
    Yes, do not attempt to read from $ENV{'QUERY_STRING'} if it is not defined. Change that line to:
    if (defined $ENV{'QUERY_STRING'}) { # assign to variable # check for login parameter }
    I'd like to echo davorg's update, though, and suggest you use CGI.pm instead:
    use CGI; my $q = CGI->new(); my $age = $q->param('age'); my $login = $q->param('login'); if ($age) { # do whatever } if ($login) { # do whatever }
    With a mighty WHOMP!, these visible warnings (and several invisible problems probably lurking in your CGI parser) will automagically disappear.
      thanks for your help, I will start changing over to CGI.pm asap ... but is there a fix that will sort the read line for now, as theres a huge ammount of updating to do to change to CGI.pm - while i do that i really need to find a fix for this :(