in reply to (jeffa) 3Re: CGI.pm error
in thread CGI.pm error

I have the same problem.

Sat Jul 12 10:38:59 2003 (eval 1): Array found where
operator expected at (eval 1) line 1, at end of line
Sat Jul 12 10:38:59 2003 (eval 1): (Do you need to
predeclare Carp::longmess?) Sat Jul 12 10:38:59 2003
(eval 1): Array found where operator expected at (eval 1)
line 2, at end of line Sat Jul 12 10:38:59 2003
(eval 1): (Do you need to predeclare Carp::shortmess?)
Sat Jul 12 10:38:59 2003 (eval 1): Array found where
operator expected at (eval 1) line 3, at end of line
Sat Jul 12 10:38:59 2003 (eval 1): (Do you need to
predeclare Carp::shortmess?) Sat Jul 12 10:38:59 2003
(eval 1): Array found where operator expected at (eval 1)
line 4, at end of line Sat Jul 12 10:38:59 2003 (eval 1)
: (Do you need to predeclare Carp::longmess?) Undefined
subroutine &Carp::longmess called at Carp.pm line 296.


My system: Windows xp with sambar 5.2

Please tell me how to work with "Set-Cookie: ", not with CGI.pm :(
(i work with cookie some 1 month). I want to build a shopping cart
and login-logout system with cookie. Please tell me were i find the
complet tutorials about the "Set-Cookie: "? I see the cookie.lib
(by Matt Wright) but i want to build my self and i want to sell my work ;) .
Please help me.

Replies are listed 'Best First'.
Re2: (jeffa) 3Re: CGI.pm error
by bart (Canon) on Jul 12, 2003 at 12:15 UTC
    You want to build a shopping cart system and sell it, though you barely understand the basics? I pity your customers.
(jeffa) 5Re: CGI.pm error
by jeffa (Bishop) on Jul 12, 2003 at 12:00 UTC
    Sorry, but i refuse to help someone write an insecure shopping cart. Why won't you use CGI.pm? You have no good reason you know. But MU on CGI.pm ... a full-blown shopping cart system (you are going to store credit card numbers?!?!) should be produced with a full-blown app server. I recommend OpenInteract. If that is too hard to work with ... then maybe you shouldn't be doing this in the first place. It's one thing to shoot your own foot off, but it's quite another to shoot everyone's foot off whose credit card number you allowed some cracker to steal.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      I change my server. The Sambar it's stupid to work
      with CGI.pm . I work now with IIS and work ok, but i
      write 2 files:

      #!/usr/bin/perl -w

      use strict;
      use warnings;
      use CGI;

      $query = new CGI;
      $cookie = $query->cookie(-name=>'test',
      -value=>'123456',-expires=>'+1y',-path=>'/'
      ,-domain=>'localhost',-secure=>0);
      print $query->header(-cookie=>$cookie);

      ------------------------------------------------
      and the secound file dont work
      -------------------------------------------------
      #!/usr/bin/perl -w

      use strict;
      use warnings;
      use CGI;

      print $query->header;
      print "<html><head>";
      print $query->title('Cookie');
      print '</head><body>';
      print $query->h3('The file cookie send to server');
      print $ENV{'HTTP_COOKIE'};
      print '</body></html>';

      ------------------------------------------------------
      WHAY?
        I have never used Sambar or IIS ... personally, if it's not Apache ... i don't consider it. I recommend you switch to Apache ... but that's just me.

        Anyhoo ... here is some code ... but if you still haven't bothered to read Ovids' Web Programming with Perl then you should - it's free you know.

        use strict; use warnings; use CGI qw(:standard); use CGI::Cookie; my %cookie = CGI::Cookie->fetch; if (exists $cookie{test}) { print header, start_html('got cookie'), p('found the cookie: ' . $cookie{test}->value), end_html, ; } else { my $cookie = CGI::Cookie->new(-name=>'test',-value=>12345); print header(-cookie=>$cookie), start_html('need cookie'), p('setting cookie, please reload'), end_html, ; }
        Now go back and look at the code i gave you at (jeffa) 3Re: CGI.pm error and see if you can get it to work. Advice webstudorio: you don't need to be building a commercial shopping cart right now ... you need to learn Perl first. Go buy a copy of Learning Perl - after you read it and understand it then read Perl For Web Site Management.

        Oh ... it's why, not 'whay'. And please, use code tags. You have been asked several times now and yet you still refuse to use code tags. You simply put a <code> tag on the line before your code and you put a </code> tag on the line after your code. Whay won't you listen? ;)

        jeffa

        L-LL-L--L-LL-L--L-LL-L--
        -R--R-RR-R--R-RR-R--R-RR
        B--B--B--B--B--B--B--B--
        H---H---H---H---H---H---
        (the triplet paradiddle with high-hat)
        
      i post your code but is the same error.
      My error it's from Sambar Server? What server(for windows) to use?