Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please undeprecate doublequoting default for heredoc string terminator #9768

Closed
p5pRT opened this issue Jun 18, 2009 · 12 comments
Closed

please undeprecate doublequoting default for heredoc string terminator #9768

p5pRT opened this issue Jun 18, 2009 · 12 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 18, 2009

Migrated from rt.perl.org#66686 (status was 'rejected')

Searchable as RT66686$

@p5pRT
Copy link
Author

p5pRT commented Jun 18, 2009

From @davidnicol

Created by @davidnicol

That without explicit quotes around the here-string terminator,
double-quote qq style interpolation occurs, is a very useful feature,
yet this feature is listed among things that are deprecated.

Please undeprecate this useful feature.

Perl Info

Flags:
    category=docs
    severity=wishlist

This perlbug was built using Perl v5.8.5 in the Red Hat build system.
It is being executed now by Perl v5.8.5 - Mon Jul 24 18:27:47 EDT 2006.

Site configuration information for perl v5.8.5:

Configured by Red Hat, Inc. at Mon Jul 24 18:27:47 EDT 2006.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=linux, osvers=2.6.9-22.18.bz155725.el, archname=s390x-linux-thread-multi
    uname='linux spark.z900.redhat.com 2.6.9-22.18.bz155725.el #1 smp thu nov 17 15:25:33 est 2005 s390x s390x s390x gnulinux '
    config_args='-des -Doptimize=-O2 -g -pipe -m64 -Dversion=5.8.5 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dprivlib=/usr/lib/perl5/5.8.5 -Dsitelib=/usr/lib/perl5/site_perl/5.8.5 -Dvendorlib=/usr/lib/perl5/vendor_perl/5.8.5 -Darchlib=/usr/lib64/perl5/5.8.5/s390x-linux-thread-multi -Dsitearch=/usr/lib64/perl5/site_perl/5.8.5/s390x-linux-thread-multi -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.8.5/s390x-linux-thread-multi -Darchname=s390x-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dinc_version_list=5.8.4 5.8.3 5.8.2 5.8.1 5.8.0'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=define uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2 -g -pipe -m64',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-2)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/usr/local/lib64 /lib64 /usr/lib64
    libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.5/s390x-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared'

Locally applied patches:
    


@INC for perl v5.8.5:
    /usr/lib64/perl5/5.8.5/s390x-linux-thread-multi
    /usr/lib/perl5/5.8.5
    /usr/lib64/perl5/site_perl/5.8.5/s390x-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.8.4/s390x-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.8.3/s390x-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.8.2/s390x-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.8.1/s390x-linux-thread-multi
    /usr/lib64/perl5/site_perl/5.8.0/s390x-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.5
    /usr/lib/perl5/site_perl/5.8.4
    /usr/lib/perl5/site_perl/5.8.3
    /usr/lib/perl5/site_perl/5.8.2
    /usr/lib/perl5/site_perl/5.8.1
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl
    /usr/lib64/perl5/vendor_perl/5.8.5/s390x-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.8.4/s390x-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.8.3/s390x-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.8.2/s390x-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.8.1/s390x-linux-thread-multi
    /usr/lib64/perl5/vendor_perl/5.8.0/s390x-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.5
    /usr/lib/perl5/vendor_perl/5.8.4
    /usr/lib/perl5/vendor_perl/5.8.3
    /usr/lib/perl5/vendor_perl/5.8.2
    /usr/lib/perl5/vendor_perl/5.8.1
    /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl
    .


Environment for perl v5.8.5:
    HOME=/root
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jun 18, 2009

From @rgs

2009/6/18 David Nicol <perlbug-followup@​perl.org>​:

That without explicit quotes around the here-string terminator,
double-quote qq style interpolation occurs, is a very  useful feature,
yet this feature is listed among things that are deprecated.

Please undeprecate this useful feature.

I wasn't aware it was deprecated. It doesn't throw a deprecation
warning and the docs (perlop) do not mention it's deprecated.

@p5pRT
Copy link
Author

p5pRT commented Jun 18, 2009

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jun 19, 2009

From @davidnicol

On Thu, Jun 18, 2009 at 5​:26 AM, Rafael
Garcia-Suarez<rgarciasuarez@​gmail.com> wrote​:

I wasn't aware it was deprecated. It doesn't throw a deprecation
warning and the docs (perlop) do not mention it's deprecated.

Oh. I seem to have misinterpreted either someone's straw man or the
warning about <<;

  Use of bare << to mean <<"" is deprecated at - line 1.

I'm not certain what the various parts of the here document syntax
are properly called, towards rewriting that. Never mind, I guess.

@p5pRT
Copy link
Author

p5pRT commented Jun 19, 2009

From @ikegami

On Fri, Jun 19, 2009 at 2​:09 PM, David Nicol <davidnicol@​gmail.com> wrote​:

On Thu, Jun 18, 2009 at 5​:26 AM, Rafael
Garcia-Suarez<rgarciasuarez@​gmail.com> wrote​:

I wasn't aware it was deprecated. It doesn't throw a deprecation
warning and the docs (perlop) do not mention it's deprecated.

Oh. I seem to have misinterpreted either someone's straw man or the
warning about <<;

Use of bare << to mean <<"" is deprecated at - line 1.

A bare << is a syntax error. Quote perlop​:

"The terminating string may be either an identifier (a word), or some quoted
text."

That's probably why it's deprecated. It's not recent either. It's been
deprecated at least since 5.6.0.

- Eric "ikegami" Brine

@p5pRT
Copy link
Author

p5pRT commented Jun 20, 2009

From @davidnicol

  Use of bare << to mean <<"" is deprecated at - line 1.

A bare << is a syntax error. Quote perlop​:

"The terminating string may be either an identifier (a word), or some quoted
text."

That's probably why it's deprecated. It's not recent either. It's been
deprecated at least since 5.6.0.

- Eric "ikegami" Brine

"removing" the deprecated "feature" would require identifying the
situation (done, with the warning) and then croaking instead of
warning when it happens, breaking production code that happens to use
this side effect of how heredoc parsing works to satisfy a concept of
consitency. Dubious. Here's a patch to move the warning from the
"deprecated" to the "syntax" category.

Inline Patch
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index e5ca400..2360042 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -141,14 +141,14 @@ Use of comma-less variable list is deprecated at - line 5.
 Use of comma-less variable list is deprecated at - line 5.
 ########
 # toke.c
-use warnings 'deprecated' ;
+use warnings 'syntax' ;
 $a = <<;

-no warnings 'deprecated' ;
+no warnings 'syntax' ;
 $a = <<;

 EXPECT
-Use of bare << to mean <<"" is deprecated at - line 3.
+bare << meaning <<"" may be confusing at - line 3.
 ########
 # toke.c
 use warnings 'syntax' ;
diff --git a/toke.c b/toke.c
index e0afa13..24c28c5 100644
--- a/toke.c
+++ b/toke.c
@@ -11286,8 +11286,9 @@ S_scan_heredoc(pTHX_ register char *s)
            s++, term = '\'';
        else
            term = '"';
-       if (!isALNUM_lazy_if(s,UTF))
-           deprecate_old("bare << to mean <<\"\"");
+       if (!isALNUM_lazy_if(s,UTF) && ckWARN(WARN_SYNTAX))
+           Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
+                        "bare << meaning <<\"\" may be confusing");
        for (; isALNUM_lazy_if(s,UTF); s++) {
            if (d < e)
                *d++ = *s;

@p5pRT
Copy link
Author

p5pRT commented Jun 20, 2009

From @schwern

David Nicol wrote​:

Use of bare << to mean <<"" is deprecated at - line 1.
A bare << is a syntax error. Quote perlop​:

"The terminating string may be either an identifier (a word), or some quoted
text."

That's probably why it's deprecated. It's not recent either. It's been
deprecated at least since 5.6.0.

- Eric "ikegami" Brine

"removing" the deprecated "feature" would require identifying the
situation (done, with the warning) and then croaking instead of
warning when it happens, breaking production code that happens to use
this side effect of how heredoc parsing works to satisfy a concept of
consitency. Dubious. Here's a patch to move the warning from the
"deprecated" to the "syntax" category.

I understand your concern about breaking code, what's the point of having a
deprecation policy if we still worry about backwards compatibility even after
clearly marking something as deprecated WITH A WARNING FOR FOURTEEN YEARS!

4633a7c (Larry Wall 1995-11-21 10​:01​:00 +1200 6448)
deprecate("bare << to mean <<\"\"");

You know what version of Perl that's from? 5.002 BETA!

Give the deprecation warnings some teeth. Make it a straight up syntax error.

--
Ahh email, my old friend. Do you know that revenge is a dish that is best
served cold? And it is very cold on the Internet!

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2009

@rgs - Status changed from 'open' to 'rejected'

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2009

From @davidnicol

On Sat, Jun 20, 2009 at 2​:40 PM, Michael G Schwern<schwern@​pobox.com> wrote​:

Give the deprecation warnings some teeth.  Make it a straight up syntax error.

You realize that making that a syntax error implies editing t/base/lex.t, right?

How about acknowledging that after fourteen years on death row without
executing this prisoner it is eligible for parole?

@p5pRT
Copy link
Author

p5pRT commented Aug 22, 2012

From @cpansprout

On Tue Jun 23 20​:37​:15 2009, davidnicol@​gmail.com wrote​:

On Sat, Jun 20, 2009 at 2​:40 PM, Michael G Schwern<schwern@​pobox.com>
wrote​:

Give the deprecation warnings some teeth. �Make it a straight up
syntax error.

You realize that making that a syntax error implies editing
t/base/lex.t, right?

How about acknowledging that after fourteen years on death row without
executing this prisoner it is eligible for parole?

I used to used << all the time, and then deprecation warnings became the
default, which was annoying. I don’t see what harm it causes to
undeprecated <<, since it is totally unambiguous.

I’m going to re-open this with the hope that we can undeprecate it.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Aug 22, 2012

@cpansprout - Status changed from 'rejected' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jun 27, 2013

@cpansprout - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant