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

Re: [PBML] Problem with string terminator

Expand Messages
  • Tom Barron
    The terminator for the here document has to start at the left margin
    Message 1 of 3 , Nov 26, 2000
    • 0 Attachment
      The terminator for the here document has to start at the left margin
      like this:

      > print<<"termina"; # LINE 14
      > <h3>
      > Thank you $dados{"First Name"} $dados{"Last Name"} for
      > registerng with the leading rein. </h3>
      > Please verify the following information and make any
      > corrections necessary.
      >
      >termina


      Rafael Steil wrote:
      > ...
      > "Can't find string terminator "termina" anywhere before EOF at
      > registra.cgi line 14."
    • Andrew Johnson
      ! Hi, I am new in the list, I am Guillermo from Argentina. ! ! Mustn t this string terminator be defined in the print line WITHOUT ! the quotation marks
      Message 2 of 3 , Nov 26, 2000
      • 0 Attachment
        ! Hi, I am new in the list, I am Guillermo from Argentina.
        !
        ! Mustn't this string terminator be defined in the print line WITHOUT
        ! the quotation marks either?
        !
        ! print <<termina;

        The quotes are optional -- you may use double quotes or no quotes
        around the terminating token and in both cases you will get
        double-quote interpolation ... you can also use single-quotes
        and the here-doc will be treated as a single quoted string:

        my $var = 'hello';
        print <<"EOF";
        This gives double quotish
        interpolation: $var
        EOF

        print <<EOF;
        This also gives double quotish
        interpolation: $var
        EOF

        print <<'EOF';
        This is a single quoted
        string: $var
        EOF

        Note, in any case where quotes are used they are only used with
        the defining statement that begins the here-doc, not around the
        terminating token. Please see the perldata manpage as well as
        perlfaq4 for further details and examples.

        regards,
        andrew
      • Guillermo Pereyra Irujo
        ... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
        Message 3 of 3 , Nov 27, 2000
        • 0 Attachment
          > > "Can't find string terminator "termina" anywhere before EOF at
          > > registra.cgi line 14."

          > The terminator for the here document has to start at the left margin
          > like this:
          >
          > > print<<"termina"; # LINE 14
          > > <h3>
          > > Thank you $dados{"First Name"} $dados{"Last Name"} for
          > > registerng with the leading rein. </h3>
          > > Please verify the following information and make any
          > > corrections necessary.
          > >
          > >termina

          Hi, I am new in the list, I am Guillermo from Argentina.

          Mustn't this string terminator be defined in the print line WITHOUT the
          quotation marks either?

          print <<termina;



          _________________________________________________________
          Do You Yahoo!?
          Get your free @... address at http://mail.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.