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

Re: Indented here docs?

Thread Previous | Thread Next
From:
ilmari
Date:
July 5, 2016 10:21
Subject:
Re: Indented here docs?
Message ID:
d8jvb0kbd1r.fsf@dalvik.ping.uio.no
Alberto Simões <albie@alfarrabio.di.uminho.pt> writes:

> On 04/07/16 22:08, Sawyer X wrote:
>>> > In any case, in case we desire the deprecation, can we add it as a
>>> > feature? As it will be active only if the user asks for it?
>> I'm not sure I understand this question. Can you please elaborate?
>
> Somebody already pointed that, too:
>  we could deprecate the <<~ notation (or <<-)

There is no "<<~ (or <<-) notation" to deprecate. it's parsed as bare <<
meaning <<"" (which has already been deprecated for 20 years!), followed
by either a unary ~, which is a syntax error, or a binary -, which
happens to work if the here-doc contains a number, and the bareword
following the - is sub returning a number.

This implies that using ~ is slightly "safer" than -, since it cannot
possibly be confused with existing valid (even deprecated) syntax.

-- 
"I use RMS as a guide in the same way that a boat captain would use
 a lighthouse.  It's good to know where it is, but you generally
 don't want to find yourself in the same spot." - Tollef Fog Heen


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