here-doc issue

L

lnatz

Hi, I'm having an issue with here docs, and I'm sure it's something
simple that I'm overlooking but it's annoying me. Here is a snippet
from my script.

sub usage {
print<<EOF;
runbook or both
EOF
exit 0;
}

It is failing with error: Can't find string terminator "EOF" anywhere
before EOF at exec_rnbk.pl line 94.
Line 94 is "print<<EOF;".

Am I missing something obvious?

Thanks in advance!
 
G

Gunnar Hjalmarsson

lnatz said:
Hi, I'm having an issue with here docs, and I'm sure it's something
simple that I'm overlooking but it's annoying me. Here is a snippet
from my script.

sub usage {
print<<EOF;

runbook or both

EOF
exit 0;
}

It is failing with error: Can't find string terminator "EOF" anywhere
before EOF at exec_rnbk.pl line 94.
Line 94 is "print<<EOF;".

Am I missing something obvious?

The docs will probably help you detect the problem:
http://perldoc.perl.org/perlop.html#<<EOF-here-doc-heredoc-here-document-<<
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top