Je55eah has asked for the wisdom of the Perl Monks concerning the following question:
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,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Please help me with this Heredoc
by toolic (Bishop) on Jun 18, 2012 at 02:20 UTC | |
by Je55eah (Novice) on Jun 18, 2012 at 03:04 UTC | |
|
Re: Please help me with this Heredoc
by afresh1 (Hermit) on Jun 18, 2012 at 02:05 UTC | |
by Je55eah (Novice) on Jun 18, 2012 at 02:24 UTC | |
|
Re: Please help me with this Heredoc
by Je55eah (Novice) on Jun 18, 2012 at 01:44 UTC | |
|
Re: [SOLVEDish] Please help me with this Heredoc
by Anonymous Monk on Jun 19, 2012 at 00:37 UTC |