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

[perl #118511] Use of bare << to mean <<"" is deprecated - make a hard error

Thread Previous
Jon Jensen via RT
July 13, 2013 05:23
[perl #118511] Use of bare << to mean <<"" is deprecated - make a hard error
Message ID:
I'd like to ask a simple question. Maybe I'm misunderstanding something obvious, but I don't see where/when this was *ever* 
deprecated or any warnings issued. Yes, Perl Best Practices proclaimed that double-quoting better showed intent. But I've 
never seen any deprecation warning, or anything in the docs that says this is deprecated.

Running Perl 5.18.0 from perlbrew:

% ./ 
Here's a quote.
% cat
#!/bin/env perl

use strict;
use warnings;

print <<END;
Here's a quote.

The Perl 5.18.0 perlop man page says:

           A line-oriented form of quoting is based on the shell "here-document" syntax.  Following a "<<" you specify a 
string to terminate the quoted material, and all lines following the current line down to the terminating string are the value 
of the item.

           The terminating string may be either an identifier (a word), or some quoted text.  An unquoted identifier works 
like double quotes.  There may not be a space between the "<<" and the identifier, unless the identifier is explicitly quoted.  
(If you put a space it will be treated as a null identifier, which is valid, and matches the first empty line.)  The 
terminating string must appear by itself (unquoted and with no surrounding whitespace) on the terminating line.

No mention of deprecation anywhere that I can see.

What am I missing?

If it had really been warned about back to Perl 5.12, and if it really simplifies the grammar, I wouldn't mind it being gone. 
But it will definitely break a ton of code. At least it's easy to fix, though. Yes according to Father Chrysostomos' last 
comment, there's no internal code simplification waiting as a reward for all the breakage.

Again, what am I missing? Where is this deprecation notice? If I hadn't come across this thread I would think there's 
absolutely nothing wrong with bareword heredocs except that Damian Conway's aesthetic preference was to avoid them. I work 
with other Perl programmers who likewise have never heard of this.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About