Loading ...
Sorry, an error occurred while loading the content.

(Might be a runaway multi-line :: string starting on line 2:what does it mean

Expand Messages
  • oykusualaca
    Does anyone familiar with the error message that I m keep receiving.I couldn t find out why I m having this error. I would appricate for any help Belinda Here
    Message 1 of 4 , Mar 3, 2004
    • 0 Attachment
      Does anyone familiar with the error message that I'm keep
      receiving.I couldn't find out why I'm having this error.

      I would appricate for any help

      Belinda

      Here is my code **********

      #!/usr/bin/perl -wT
      use CGI qw:standard/;
      $velcome="This is my stage3";
      $products="These are our products";
      print header();
      print start_html"This is my stage3";
      print $velcome,"\n";
      print "<center>\n";
      print request_method();
      if (request_method() eq "GET")

      {
      open PROD ,"products.db";
      print $products, "\n";
      #these below three lines are in a seperate form for checkout purpose
      print qq~<form method ="PSOT"action ="cgi-bin/pr3stage3.cgi">\n~;
      print qq~<input type="submit" name="submit" value="CHECK OUT">\n~;
      print "</form>\n";

      print <"table border=1 bordercolor=blue>\n;
      while (<PROD>>)

      {
      chomp;
      @fields=split / \ # / ;
      #Each record will be a self contained fprom used for updating records

      print qq~\t<tr>\n~;
      Print qq~\t\t<td><form method="post" action="/cgi-
      bin/pr3/stage3.cgi">\n~;
      print qq~ \t\t\t <img src="impath$fields[3]">\n~;
      print qq~\t\t\t<td><b>Product
      ID:$fields[0]</b><br><b>Name:</b>$fields[1]<br>\n~;
      print qq~\t\t\t<b>Price:</b>$fields[3]<br>\n~;
      print qq~\t\t<td><br>\n~;
      print qq~\t\t\t<input type="submit" value="Add to Card"
      name="submit"><p>\n~;
      print qq~\t\t\t<input type="hidden" name="key" value="$fields
      [0]"><p>\n~;
      print qq~</form>\n~;
      }
      print "</table>\n";
      }
      #This request is an update is in progress
      elseif (request_method() eq "POST")
      if (param('submit') eq "Add to Card" )
      #copy checked line to a new cart.dat file

      {
      open PROD, "products.dat";
      open CARD,">>cart.dat";
      seek (CART, 0,2);

      while (<PROD>)
      {
      chomp;
      @fields=split /\ # /;
      #This tried to locate the desired record
      if ($fields[0] eq param('key')
      {
      print CARD qq~$fields [1] | $fields[2]\n~;
      }
      }
      close CART;
      close PROD;
      print "The selected item was added to the cart<br>\n";
      print"<h3>TAHNKS</h3><br>\n";
      print qq~<a href="http://zenit.senecac.on.ca:6480/cgi-
      bin/pr3/stage3.cgi">Back
      to shopping</a><br>\n~;

      print qq~<form method="post" action ="cgi-bin/pr3/stage3.cgi">\n~;
      print qq~<input type=submit" name ="submit" value="CHECK OUT">\n~;
      print "</form>\n";

      #--------------------------------------------------------------------
      ------------

      in case of LOGIN

      if (param('submit') eq "LOGIN")
      {
      $cust_name=param("LoginName");
      $cust_ccard=param("CustCard");
      if ($cust_name ! ~ / ^ \ w+ $ / ) {
      print qq ~ERROR the name msut be a alphabetic
      <br>\n~;
      $flagCard="problem";
      }
      if (flagName ne "problrm " && $flagCard ne "problem") {
      #--$cust_password=param(LoginPassword);
      print qq~Now you can check out <br>\n~;
      print qq~<form method="POST" action="/cgi-bin/pr3/stage3.cgi">\n~;
      print qq ~<input type="hidden" name="logname" value="$cust_name">\n~;
      print qq~<input type="hidden" name ="ccard" value="$ccard">\n~;
      print qq~<input type="submit" name ="submit" value="CHECK OUT">\n~;
      print "</form>\n";
      }
      }

      #----------Below code will be executed if a customer clicked CHECK
      OUT button

      if (param('submit') eq "CHECK OUT")
      {
      print qq~</center><br>\n~;
      open CUST,"customer.db";
      while (<CUST>)
      {
      chomp;
      @customers =split / \ | / ;
      if ($customers [1] eq param ("logname") &&
      $customers [7] eq param ("ccard"))
      {
      print qq~ <b>This invoice is issued to the following
      customer</b><p>\n~;
      print qq ~----------------------------------------
      <br>\n~;
      print qq
      ~Name:...................................$customers[1]<br>\n~;
      print qq ~Credit Card
      Number:...................................$customers[2]<br>\n~;
      #print qq
      ~City:...................................$customers[3]<br>\n~;
      #print qq
      ~Province:...................................$customers[4]<br>\n~;
      #print qq ~Postal
      Code:...................................$customers[5]<br>\n~;
      #print qq ~E-
      mail:...................................$customers[6]<br>\n~;
      print qq~--------------------------------------
      <br>\n~;
      }
      }
      if (param("logname") eq "")
      {
      print qq~<h3>SORRY<h3><br>\n~;
      print qq~You are not registered in our database<br>\n~;
      print qq~<form method="POST" action="/cgi-
      bin/pr3/stage3.cgi">\n~;
      print qq~Login Name----------------------------<input
      type="text
      name="LoginName"><br>\n~;
      print qq ~Credit Card Number:--------------------------------
      ----------<input
      type="text" name="CustCard"><br>\n~;
      print qq~<input type = "submit" name="submit"
      value="LOGIN">\n~;
      print "</form>\n";
      }
      close CUST;
      open CHECK,"cart.dat";
      while (<CHECK>)
      {

      chomp;
      @fields=split/ \ | / ;
      #just checking if the desired quanitity conflicts
      with the quantity in stock
      #if Q_desired is > Q_stock then sold will be Q_stock
      #time to do math
      #$money=$fields[2] * sold;
      $money=$fields[1];
      #total_ money=$total_money + $money;
      #---print invoice
      print qq~You
      bought :..................$fields[0]<br>\n~;
      print qq~Unit
      Price:.......................\$$fields[1]<br>\n~;
      #print qq~total quantity:........$fields[3]
      <br>\n~;
      #print qq~total price:........$money<br>\n~;
      }
      $gst=$money * 0.15;
      print qq~TAX (15%) is :...........$gst <br>\n~;
      $total =$gst + $money;
      print qq~............<br>\n~;
      print qq~Total charge is :.............$total
      <br>\n~;
      print qq~...........>br>\n~;
      print qq~<h3>Thank you</h3><br>\n~;
      rename "Cart.dat" , "" ;
      close CHECK;
      }
      #}
      #Finish up and clelanup
      print "</center>\n";
      print end_html( ) ;
      close PROD;
      print "\n";
    • merlyn@stonehenge.com
      ... oykusualaca use CGI qw:standard/; use CGI qw/:standard/; -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      Message 2 of 4 , Mar 3, 2004
      • 0 Attachment
        >>>>> "oykusualaca" == oykusualaca <oykusualaca@...> writes:

        oykusualaca> use CGI qw:standard/;

        use CGI qw/:standard/;


        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
        See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
      • Paul Archer
        Just a suggestion: if the error message indicates the error is on line 2, don t include the whole script--especially if it s as long as this one... ... If you
        Message 3 of 4 , Mar 3, 2004
        • 0 Attachment
          Just a suggestion: if the error message indicates the error is on line 2,
          don't include the whole script--especially if it's as long as this one...


          8:34pm, oykusualaca wrote:

          > Does anyone familiar with the error message that I'm keep
          > receiving.I couldn't find out why I'm having this error.
          >
          > I would appricate for any help
          >
          > Belinda
          >
          > Here is my code **********
          >
          > #!/usr/bin/perl -wT
          > use CGI qw:standard/;
          > $velcome="This is my stage3";


          -----------------------------------------------------------
          If you live in a small town /You might meet a dozen or two/
          Young alien types /Who step out /And dare to declare/
          "We're through being cool." -- Devo, "Through Being Cool"
          -----------------------------------------------------------
        • Pankaj Udasin
          Hi Belinda, This error means somewhere in the code (not necessarily the line no mentioned in the error, usually a few lines before the mentioned line no.) the
          Message 4 of 4 , Mar 3, 2004
          • 0 Attachment
            Hi Belinda,
            This error means somewhere in the code (not necessarily the line no
            mentioned in the error, usually a few lines before the mentioned line
            no.) the single quotes or double quotes are not closing.
            The line below in the your code had a missing doulble quote, hence the
            error.

            print <"table border=1 bordercolor=blue>\n;

            it should be
            print "<table border=1 bordercolor=blue>\n";

            regards,
            pankaj.



            ----------------------------------------------------------------

            NETCORE SOLUTIONS *** Ph: +91 22 5662 8000 Fax: +91 22 5662 8134

            MailServ and FlexiMail: Messaging Solutions: http://netcore.co.in

            Pragatee: Integrated Server-Software Suite: http://www.pragatee.com

            Emergic Freedom: Server-centric Computing: http://www.emergic.com

            BlogStreet: Blog Profiles and RSS Ecosystem: http://blogstreet.com

            Deeshaa: Rural Development: http://www.deeshaa.com

            Rajesh Jain's Weblog on Technology: http://www.emergic.org
            ----------------------------------------------------------------
          Your message has been successfully submitted and would be delivered to recipients shortly.