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
From:
Jon Jensen via RT
Date:
July 13, 2013 05:23
Subject:
[perl #118511] Use of bare << to mean <<"" is deprecated - make a hard error
Message ID:
rt-3.6.HEAD-2552-1373537118-585.118511-14-0@perl.org
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:

% ./heredoc-test.pl 
Version=5.018000
Here's a quote.
% cat heredoc-test.pl
#!/bin/env perl

use strict;
use warnings;

print <<END;
Version=$]
Here's a quote.
END

The Perl 5.18.0 perlop man page says:

       <<EOF
           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.

Jon

Thread Previous


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