I think that Rob was onto something, here
is my 2 cents.
The print line should be like this:
print <<EOF
and not
print< < EOF
like you have. I think maybe that what is
happening is that the error that is being printed is saying that it cannot find
“<space>EOF” before end of file. Put the space between the word print,
and remove the spaces between the << and EOF, then ensure you don’t have
a space or a tab or control characters before or after the EOF and it should
work.
Let me know if this helps.
Chris Hood
RHCE (RedHat
Certified Engineer)
C |EH
(Certified Ethical Hacker)
Linux Systems
Administrator
An advantage to the
"release early and often" paradigm is that bugs can be discovered
faster. The disadvantage is that you may cause things to go down... sometimes
in a very, very bad way.
From:
"lnatz" <[EMAIL PROTECTED]> [mailto:"lnatz"
<[EMAIL PROTECTED]>]
Sent: Wednesday, July 18, 2007
10:27 AM
To: beginners@perl.org
Subject: heredoc issure
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 usageAndDie {
print< < EOF;
>> The following single-character otions are accepted:
>> wih arguments: -T -S
>> without arguments(boolean): -g -e
>> Use:
>> -T followed by a target
>> -S followed by a source
>> -g to generate a runbook
>> -e to execute the runbook
>> Requirements:
>> you must specify a target and a source
>> you must specify either to generate a runbook, execute the
runbook or both
>> Example: perl exec_rnbk.pl -T UT -S testing -g
EOF
exit 0;
}
Its failing with the error: Can't find string terminator "EOF"
anywhere before EOF at exec_rnbk.pl line 94.
Line 94 is "print< < EOF;".
Am I just missing something obvious here?
Thanks in advance!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/