in reply to Re^5: Testing for existence of cookies
in thread Testing for existence of cookies

At the beginning, Like I said, if I use if (!defined($cgi->cookie('name'))) I don't get any errors, It just doesn't work. when I tryed if (defined($cgi->cookie('name'))) I keep geting a 500 internal server error. The script won't run. I know that the ! means not defined. But thats not what I want. I want to is if one of 3 is defined and then do some thing. I have to make changes so I could get this script running, its just not running the way I want.

Replies are listed 'Best First'.
Re^7: Testing for existence of cookies
by bmann (Priest) on Jun 26, 2005 at 22:14 UTC
    The code you posted looks valid. You need to help others help you.

    If you have access to your server logs, please post the error.

    If not, add the following: use CGI::Carp 'fatalsToBrowser'; after the shebang but before any other lines in your script and post the error shown.

    You should probably read Troubleshooting Perl CGI scripts as well.

      It's like I said, I'm not getting any errors. It guest won't detect the cookies if (defined($cgi->cookie('name'))) Doesn't work. I keep get 500 internal server errors, and O don't have access to server logs
        Well, it sucks that you don't have access to server logs. Makes debugging much more difficult. Have you considered another hosting company?

        Anyway, back on topic, did you try CGI::Carp? use CGI::Carp 'fatalsToBrowser'; will print headers and then print the error message that caused the script to fail (most of the time). Again, put it near the top of the script, before any other statements but after the shebang line. Try that and post the results...