I feel stupid asking this but, how can I make this here doc work? I have looked at http://perldoc.perl.org/perlfaq4.html#Why-don't-my-%3c%3cHERE-documents-work%3f
$author = 'Jesse'; $date = scalar localtime; $document = <<ENDHEREDOC; Hello $author. The time is: $date ENDHEREDOC print $document;
and the result is:
Can't find string terminator "ENDHEREDOC" anywhere before EOF at test. +pl line 3. Press any key to continue . . .
As an aside, is there a nice and simple way to get the current local date time as YYYY-MM-DD-HH:MM:SS ? All of the examples I was finding were multistep processes involving adding numbers to 1900 and so on. I threw this scalar thing in because i wondered what it would do, but the HEREDOC is holding things up, so I havn't seen the result yet. Thanks,
In reply to [SOLVEDish] Please help me with this Heredoc by Je55eah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |