develooper Front page | perl.perl5.porters | Postings from November 2016

Re: Indented here docs?

Thread Previous | Thread Next
From:
David Nicol
Date:
November 12, 2016 20:39
Subject:
Re: Indented here docs?
Message ID:
CAFwScO8N5g7hnGpWNqS8su+h5zh=g8Qvh5paE1YwVaSKu2iwqQ@mail.gmail.com
Should the tests put a newline after the literal "EOF" token instead
of just ending the file there? Does fresh_perl_is take care of that?

Also, does the empty delimiter still work when there's nothing else
printable on the line, like so? Or with an explicitly empty delimiter
? Because that's occasionally useful.

print <<
Hi

__END__

print << ''
Hi

__END__

On Sat, Nov 12, 2016 at 9:24 AM, Matthew Horsfall (alh)
<wolfsage@gmail.com> wrote:
> On Fri, Nov 11, 2016 at 8:40 AM, Matthew Horsfall (alh)
> <wolfsage@gmail.com> wrote:
>> Status update:
>>
>> I reworked the indented-heredocs branch on top of base and added some
>> documentation finally:
>>
>>   https://perl5.git.perl.org/perl.git/shortlog/refs/heads/smoke-me/alh/indented-heredocs
>>
>> I would appreciate some final review of the docs/code, but if there's
>> nothing horrible that comes up I plan to push this to blead on Monday.
>>
>
> Branch updated to allow spaces before and after the ~ modifier:
>
>   print << ~ EOF;
>     ...
>     EOF
>
> Also added a fix for broken behaviour in existing heredocs:
>
>   https://perl5.git.perl.org/perl.git/commitdiff/981f4010c806ce68c251251139ce956da6f151f9
>
> This worked:
>
>   print << 'EOF';
>
> But this didn't:
>
>   print << EOF;
>
> Now it does.
>
> -- Matthew Horsfall (alh)



-- 
"Teaching radical novelties is our main safeguard against
dictatorships" -- Edsger W. Dijkstra

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About