Can't find string terminator “str” anywhere before EOF

前端 未结 3 1283
无人及你
无人及你 2021-01-17 16:24

Why I get this error?

use strict;
use warnings;

my $str = <

        
相关标签:
3条回答
  • 2021-01-17 16:52

    You can use diagnostics to get more verbose help on warning messages:

    Can't find string terminator "str" anywhere before EOF (F) Perl strings can stretch over multiple lines. This message means that the closing delimiter was omitted. Because bracketed quotes count nesting levels, the following is missing its final parenthesis:

        print q(The character '(' starts a side comment.);
    

    > If you're getting this error from a here-document, you may have included unseen whitespace before or after your closing tag. A good programmer's editor will have a way to help you find these characters.

     Uncaught exception from user code:
    

    Can't find string terminator "str" anywhere before EOF

    0 讨论(0)
  • 2021-01-17 17:02

    Or Better Use Eclipse Perl Integration plug-in or Padre for editing your perl code. It shows real-time syntax related errors.

    0 讨论(0)
  • 2021-01-17 17:14

    You should not have a space here:

    str 
       ^
    

    The heredoc terminator should be on a line by itself and should not have anything (not even space) surrounding it.

    0 讨论(0)
提交回复
热议问题