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

strict doesn't complain when sort quotes bareword argument #2305

Open
p5pRT opened this issue Aug 3, 2000 · 5 comments
Open

strict doesn't complain when sort quotes bareword argument #2305

p5pRT opened this issue Aug 3, 2000 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 3, 2000

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

Searchable as RT3629$

@p5pRT
Copy link
Author

p5pRT commented Aug 3, 2000

From @pjscott

If a bareword argument is given to sort, strict 'subs' doesn't complain​:

$ perl -Mstrict -wle 'print sort foo'
foo
$

Just so you know that the bareword interpretation is being applied​:

$ perl -MO=Deparse -wle 'print sort foo'

print sort('foo');

-e syntax OK

Happens on perl 5.6.0 & 5.005_03 on Linux, and Perl 5.004_04 on Solaris 2.5.1.

@p5pRT
Copy link
Author

p5pRT commented Aug 3, 2000

From @Abigail

On Thu, Aug 03, 2000 at 09​:55​:38AM -0700, Peter Scott wrote​:

If a bareword argument is given to sort, strict 'subs' doesn't complain​:

$ perl -Mstrict -wle 'print sort foo'
foo
$

Just so you know that the bareword interpretation is being applied​:

$ perl -MO=Deparse -wle 'print sort foo'

print sort('foo');

-e syntax OK

And this is probably related​:

  $ perl -Mstrict -e 'exec ls' | wc -l
  198
  $ perl -MO=Deparse -Mstrict -le 'exec ls'

  exec 'ls';

  -e syntax OK
  $

However, in this case, -w *does* complain.

  $ perl -Mstrict -we 'exec ls' | wc -l
  Unquoted string "ls" may clash with future reserved word at -e line 1.
  198
  $

Abigail

@p5pRT
Copy link
Author

p5pRT commented Jul 25, 2010

From @gannett-ggreer

The "exec" part mentioned has been fixed in the tickets linked, however
sort() does not complain yet.

--
George Greer

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2012

From @jkeenan

On Thu Aug 03 02​:55​:42 2000, Peter@​PSDT.com wrote​:

If a bareword argument is given to sort, strict 'subs' doesn't
complain​:

$ perl -Mstrict -wle 'print sort foo'
foo
$

Just so you know that the bareword interpretation is being applied​:

$ perl -MO=Deparse -wle 'print sort foo'

print sort('foo');

-e syntax OK

Happens on perl 5.6.0 & 5.005_03 on Linux, and Perl 5.004_04 on
Solaris 2.5.1.

And is still present in Perl 5.14.2​:

#####

$ perl -Mstrict -wle 'print sort foo'
foo

$ perl -Mstrict -wlE 'say sort foo'
foo

#####

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2012

From @cpansprout

On Fri Apr 20 18​:21​:28 2012, jkeenan wrote​:

On Thu Aug 03 02​:55​:42 2000, Peter@​PSDT.com wrote​:

If a bareword argument is given to sort, strict 'subs' doesn't
complain​:

$ perl -Mstrict -wle 'print sort foo'
foo
$

Just so you know that the bareword interpretation is being applied​:

$ perl -MO=Deparse -wle 'print sort foo'

print sort('foo');

-e syntax OK

Happens on perl 5.6.0 & 5.005_03 on Linux, and Perl 5.004_04 on
Solaris 2.5.1.

And is still present in Perl 5.14.2​:

#####

$ perl -Mstrict -wle 'print sort foo'
foo

$ perl -Mstrict -wlE 'say sort foo'
foo

#####

use constant{Just=>another=>Perl=>hacker=>};$\=",\n";
print join" ",map eval"sort $_,$_",qw! Just Perl!

--

Father Chrysostomos

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

2 participants