in reply to Could you look over my completed (but not working) short .cgi script?

Greetings, StarRice.

Since I understand this is homework. I'll not solve the issue(s) for you. But rather, give you a reading assignment. :)

Please read the fine Perl documentation. Especially perlop, specifically for your case Quote and Quote like Operators. Other keywords you might find useful are interpolate, and interpolation. As well as print, quote, and quote characters. Lastly, use diagnostics; will often tell you exactly what was wrong, and suggest ways to correct it.

Best wishes.

--Chris

¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

  • Comment on Re: Could you look over my completed (but not working) short .cgi script?

Replies are listed 'Best First'.
Re^2: Could you look over my completed (but not working) short .cgi script?
by StarRice (Novice) on May 31, 2014 at 06:37 UTC

    Alright, thank you. I read the documentation...yikes. It goes way beyond the book we had (a basic book. And I added  use diagnostics, however I don't understand how it thinks I think a 'delimitter' in the middle of my HTML title, do I need to add semi-colons to the end of all of them? I'm able to get help on assignments directly, just not like...if I had asked someone to do it for me. I've never encountered a problem like this though before, it was all simple stuff.

      Ugh. This is really difficult for me too. It would be so easy for me to "spill the beans". But given this is an assignment. I can only point you toward the text that supplies you with the information you need to solve your problem. I gave you some other key words to search for, that would have armed you with the answers. Let me just suggest that quoting really is the key here. As is interpolation. If you continue down the page I gave you in the "reading assignment", and read the section "Gory details of parsing quoted constructs". You should also find clues to what you've done incorrectly. While doing so, think quoting quotes. That may help you discover what you need to know.

      Best wishes.

      --Chris

      ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

        No worries! I actually got both of them working by trial and error. :) Seems like that's the one true way to fix things in programming, and of course reading. The document you linked me will be fun to read in my free time just to get the hang of Perl. Thanks a whole bunch. Now...for my foreach statement in the 2nd script, its not displaying properly the items saved in the cookie '$C_basket'. It's just a blank section. Is that correct? I was never good with the 'foreach/for/if' statements. (Shame on me, I know)
Re^2: Could you look over my completed (but not working) short .cgi script?
by StarRice (Novice) on May 31, 2014 at 06:43 UTC
    I spoke too soon! I figured it out on the first one. :) Trial and error works successfully sometimes I guess, haha. Thank you! Let me try my hand at the second one now.