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

new <<>> operator deparses the same as <> #14615

Open
p5pRT opened this issue Mar 23, 2015 · 5 comments
Open

new <<>> operator deparses the same as <> #14615

p5pRT opened this issue Mar 23, 2015 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 23, 2015

Migrated from rt.perl.org#124157 (status was 'open')

Searchable as RT124157$

@p5pRT
Copy link
Author

p5pRT commented Mar 23, 2015

From @kentfredric

I mentioned this in passing in #123990, but it warrants its own bug.


perl -e 'while(readline){ print $_ }' 'echo insecure |'
Can't open ls -la |​: No such file or directory at -e line 1.

perl -MO=Deparse -e 'while(readline){ print $_ }' 'echo insecure |'
while (defined($_ = <ARGV>)) {
  print $_;
}

perl -MO=Deparse -e 'while(<<>>){ print $_ }' 'echo insecure |'
while (defined($_ = <ARGV>)) {
  print $_;
}

perl -MO=Deparse -e 'while(<>){ print $_ }' 'echo hello |'
while (defined($_ = <ARGV>)) {
  print $_;
}

perl -e 'while(defined($_ =<ARGV>)){ print $_ }' 'echo insecure |'
insecure


5.21.10


Flags​:
  category=core
  severity=low


Site configuration information for perl 5.21.10​:

Configured by kent at Mon Mar 23 03​:27​:39 NZDT 2015.

Summary of my perl5 (revision 5 version 21 subversion 10) configuration​:
 
  Platform​:
  osname=linux, osvers=3.19.0-gentoo, archname=x86_64-linux
  uname='linux katipo2 3.19.0-gentoo #22 smp preempt fri feb 13 16​:58​:10 nzdt 2015 x86_64 intel(r) core(tm) i5-2410m cpu @​ 2.30ghz genuineintel gnulinux '
  config_args='-de -Dprefix=/home/kent/perl5/perlbrew/perls/5.21.10 -Dusecbacktrace -Doptimize= -fno-stack-protector -O3 -march=native -mtune=native -g -ggdb3 -Dman1dir=none -Dman3dir=none -Dusedevel -Accflags= -fno-stack-protector -DPERL_HASH_FUNC_SDBM -DUSE_C_BACKTRACE_ON_ERROR -Aldflags= -fno-stack-protector -lbfd -Aeval​:scriptdir=/home/kent/perl5/perlbrew/perls/5.21.10/bin'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-stack-protector -DPERL_HASH_FUNC_SDBM -DUSE_C_BACKTRACE_ON_ERROR -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -DUSE_C_BACKTRACE -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize=' -fno-stack-protector -O3 -march=native -mtune=native -g -ggdb3',
  cppflags='-fno-stack-protector -DPERL_HASH_FUNC_SDBM -DUSE_C_BACKTRACE_ON_ERROR -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong'
  ccversion='', gccversion='4.9.2', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fno-stack-protector -lbfd -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed /usr/lib /usr/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
  libs=-lpthread -lnsl -lnm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
  perllibs=-lpthread -lnsl -lnm -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.20.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.20'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -fno-stack-protector -O3 -march=native -mtune=native -g -ggdb3 -L/usr/local/lib -fstack-protector-strong'


@​INC for perl 5.21.10​:
  /home/kent/perl5/perlbrew/perls/5.21.10/lib/site_perl/5.21.10/x86_64-linux
  /home/kent/perl5/perlbrew/perls/5.21.10/lib/site_perl/5.21.10
  /home/kent/perl5/perlbrew/perls/5.21.10/lib/5.21.10/x86_64-linux
  /home/kent/perl5/perlbrew/perls/5.21.10/lib/5.21.10
  .


Environment for perl 5.21.10​:
  HOME=/home/kent
  LANG (unset)
  LANGUAGE=
  LC_CTYPE=en_NZ.UTF8
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/home/kent/perl5/perlbrew/bin​:/home/kent/perl5/perlbrew/perls/5.21.10/bin​:/home/kent/perl5/perlbrew/bin​:/home/kent/perl5/perlbrew/perls/5.21.8-c/bin​:/home/kent/.perl6/2013.04/bin​:/home/kent/.gem/ruby/1.8/bin/​:/home/kent/.rvm/gems/ruby-2.1.2/bin​:/home/kent/.rvm/gems/ruby-2.1.2@​global/bin​:/home/kent/.rvm/rubies/ruby-2.1.2/bin​:/usr/local/bin​:/usr/bin​:/bin​:/opt/bin​:/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2​:/usr/games/bin​:/home/kent/.rvm/bin​:/home/kent/.rvm/bin
  PERL5LIB=
  PERLBREW_BASHRC_VERSION=0.72
  PERLBREW_HOME=/home/kent/.perlbrew
  PERLBREW_LIB=
  PERLBREW_MANPATH=/home/kent/perl5/perlbrew/perls/5.21.10/man
  PERLBREW_PATH=/home/kent/perl5/perlbrew/bin​:/home/kent/perl5/perlbrew/perls/5.21.10/bin
  PERLBREW_PERL=5.21.10
  PERLBREW_ROOT=/home/kent/perl5/perlbrew
  PERLBREW_VERSION=0.72
  PERL_BADLANG (unset)
  PERL_LOCAL_LIB_ROOT=
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Mar 23, 2015

From @kentfredric

Ugh. Ignore the top line of the quote w/ "readline" It got stuck in my paste buffer by accident from the other bug.

But I assure you, all the others are still doing what they claim to do.

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2015

From @rgarcia

On 23 March 2015 at 14​:45, Kent Fredric <perlbug-followup@​perl.org> wrote​:

perl -MO=Deparse -e 'while(<<>>){ print $_ }' 'echo insecure |'
while (defined($_ = <ARGV>)) {
print $_;
}

This should be fixed by 65ef2c3 :

$ bleadperl -MO=Deparse -e 'while(<<>>){}'
while (defined($_ = <<>>)) {
  ();
}
-e syntax OK

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2015

From @ilmari

Rafael Garcia-Suarez <rgs@​consttype.org> writes​:

On 23 March 2015 at 14​:45, Kent Fredric <perlbug-followup@​perl.org> wrote​:

perl -MO=Deparse -e 'while(<<>>){ print $_ }' 'echo insecure |'
while (defined($_ = <ARGV>)) {
print $_;
}

This should be fixed by 65ef2c3 :

$ bleadperl -MO=Deparse -e 'while(<<>>){}'
while (defined($_ = <<>>)) {
();
}
-e syntax OK

How about a test, so it doesn't break again?

--
"The surreality of the universe tends towards a maximum" -- Skud's Law
"Never formulate a law or axiom that you're not prepared to live with
the consequences of." -- Skud's Meta-Law

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

No branches or pull requests

2 participants