perl 此间文档

perl 此处文档print EOFToday is mon mar 12 12:58:04\nEOF为什么有出错信息 Cant find string termin

perl 此处文档
print <<EOF;
 Today is mon mar 12 12:58:04\n
EOF

为什么有出错信息 Can't find string terminator "EOF" anywhere before EOF at 1.pl line 4.

[解决办法]

Perl code
#!/usr/bin/perluse strict;use warnings;print <<EOF;Today is mon mar 12 12:58:04\nEOF##这里需要有内容(空行也行),保证EOF不是最后一行