hmbscully has asked for the wisdom of the Perl Monks concerning the following question:

UPDATE: solved it. It was the stupid missing newline, even though I know I checked for that several times.

I have this simple block of unremarkable code

if ($firstname4 ne "") { print <<SEC4_INFO; <p>$firstname4 $lastname4<br> $title4<br> phone: $phone4<br> email: $user_email4</p> SEC4_INFO }

Everytime I try to validate the script, it gives me the old "can't find string terminator before..." line. If I comment this out, the code validates fine, so it has to be this. But am I blind or do I not have the terminator line in there as it should be?? Is it something with the if statement that is making it not validate?


I learn more and more about less and less until eventually I know everything about nothing.

Replies are listed 'Best First'.
Re: Can't find string terminator problem
by grinder (Bishop) on Apr 03, 2007 at 19:11 UTC

    If that is a a direct cut'n'paste from your code, there appears to be trailing spaces after your heredoc terminator, SEC4_INFO. Get rid of them, your heredoc delimiters will match and everything will be fine.

    If pain persists, consult your doctor in the morning.

    • another intruder with the mooring in the heart of the Perl