in reply to Re: cannot Access the sub-routine
in thread cannot Access the sub-routine

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

Replies are listed 'Best First'.
Re^3: cannot Access the sub-routine
by Joost (Canon) on Jul 19, 2004 at 17:39 UTC
    Then your enhancements are probably the source of the problem. :-) You could try posting just the routines you've changed, people generally can't be bothered to go through pages and pages of code to find someone else's syntax error :-)

    Have you looked at your error-logs already? Perl might have told you something important.

    If you really can't narrow it down, and the file's really big, try putting the code on some server and make a link to it.

      I added a subroutine to the existing script .
      sub readCookies
      {
      use CGI qw/:standard/;
      if (my $time = cookie('WBSession')) {

      $testVal = "Cookie Exists";

      } else {
      $testVal = "Cookie Does Not Exists";
      }

      return $testVal;
      }
      I also added below one line which prints on the top of the screen.
      print "Content-type: text/html \n";
      print "set-cookie: WBSession=$sessionInfo; path=/cgi-bin;\n\n";
      print "set-cookie: TestCookie=$sessionInfo; path=/cgi-bin;\n\n";// added and this gets prints
      If you wish I would like to email the code which I am working on
      Thanks
      blazix
      Hello Monks,
      Now I got to know why I am getting the error and fixed it.I appreciate your immediate response.

      Actually I am trying to create more than one cookie but whichever is set first that is remaining as the cookie and other is getting printed on the screen at the top.So what should I do to have more than one cookies.
      I donot want to create array of cookies.Since this is existing application I donot want to disturb the one which application is already using.
      So guide me to right approach.

      Blazix
      If you wish I would like to email to you.
        The source I just added is
        sub readCookies
        {
        use CGI qw/:standard/;
        if (my $time = cookie('WBSession')) {

        $testVal = "Cookie Exists";

        } else {
        $testVal = "Cookie Does Not Exists";
        }

        return $testVal;
        }
        And I tried adding the below line to the code existing code.
        print "set-cookie: WBSession=$sessionInfo; path=/cgi-bin;\n\n";
        print "set-cookie: TestCookie=$testVal; \n\n";//added
        Whenever I add this I get the set-cookie: TestCookie=$testVal printed on the top of the screen. why is it like this ?