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

Re: Indented here docs?

Thread Previous | Thread Next
July 5, 2016 10:21
Re: Indented here docs?
Message ID:
Alberto Simões <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About