Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.95k stars 554 forks source link

barewords with no errors #6130

Closed p5pRT closed 21 years ago

p5pRT commented 21 years ago

Migrated from rt.perl.org#18927 (status was 'resolved')

Searchable as RT18927$

p5pRT commented 21 years ago

From dwall@fastmail.fm

Created by dwall@fastmail.fm

The code below executes with no errors or warnings; output is '1bad'.

  use strict;   use warnings;   print 1..1\, bad;

I'm using Windows 2000 5.00.2195\, Service Pack 2.

(apologies for any formatting errors. perlbug didn't seem to send mail\, so I pasted into my mail client.)

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.6.1: Configured by dkw0 at Mon Aug 20 12:26:50 2001. Summary of my perl5 (revision 5 version 6 subversion 1) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cl', ccflags ='-nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX', optimize='-O1 -MD -DNDEBUG', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -release -libpath:"C:\Perl\lib\CORE" -machine:x86' libpth="C:\Perl\lib\CORE" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release -libpath:"C:\Perl\lib\CORE" -machine:x86' Locally applied patches: ACTIVEPERL_LOCAL_PATCHES_ENTRY @INC for perl v5.6.1: C:/Perl/lib C:/Perl/site/lib . Environment for perl v5.6.1: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=C:\WINNT\system32;C:\WINNT;C:\Perl\bin\;C:\WINNT\System32\Wbem;C:\Prog ram Files\Common Files\Adaptec Shared\System;C:\PROGRA~1\ULTRAE~1;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;c:\Python22\; PERL_BADLANG (unset) SHELL (unset) ```
p5pRT commented 21 years ago

From @schwern

On Fri\, Dec 06\, 2002 at 10​:39​:49PM -0000\, David Wall wrote​:

The code below executes with no errors or warnings; output is '1bad'.

use strict;
use warnings;
print 1\.\.1\, bad;

This has been fixed in 5.8.0.

$ perl5.8.0 -w   use strict;   use warnings;   print 1..1\, bad; Bareword "bad" not allowed while "strict subs" in use at - line 3. Execution of - aborted due to compilation errors.

--

Michael G. Schwern \schwern@​pobox\.com http​://www.pobox.com/~schwern/ Perl Quality Assurance \perl\-qa@​perl\.org Kwalitee Is Job One I need a SHOWER a BURGER and some ROBOTS\, STAT!   -- http​://www.angryflower.com/allrigh.gif

p5pRT commented 21 years ago

@rspier - Status changed from 'new' to 'resolved'

p5pRT commented 21 years ago

From @nwc10

On Fri\, Dec 06\, 2002 at 08​:19​:52PM -0800\, Michael G Schwern wrote​:

On Fri\, Dec 06\, 2002 at 10​:39​:49PM -0000\, David Wall wrote​:

The code below executes with no errors or warnings; output is '1bad'.

use strict;
use warnings;
print 1\.\.1\, bad;

This has been fixed in 5.8.0.

And it turns out wasn't broken in 5.005​:

nick@​Bagpuss [nick]$ perl5.00503 -w   use strict;   print 1..1\, bad; Bareword "bad" not allowed while "strict subs" in use at - line 2. Unquoted string "bad" may clash with future reserved word at - line 2. Execution of - aborted due to compilation errors.

But I wasn't aware of any of this until just now. Thanks for the report.

Nicholas Clark -- INTERCAL better than perl? http​://www.perl.org/advocacy/spoofathon/

p5pRT commented 21 years ago

From @andk

On Sat\, 7 Dec 2002 14​:24​:20 +0000\, Nicholas Clark \nick@​unfortu\.net said​:

  > And it turns out wasn't broken in 5.005​:

  > nick@​Bagpuss [nick]$ perl5.00503 -w   > use strict;   > print 1..1\, bad;   > Bareword "bad" not allowed while "strict subs" in use at - line 2.   > Unquoted string "bad" may clash with future reserved word at - line 2.   > Execution of - aborted due to compilation errors.

  > But I wasn't aware of any of this until just now. Thanks for the report.

Indeed thanks! Blame analysis follows​:

----Program----   use strict;   print 1..1\, bad;

----Output of /usr/local/perl-5.005_61@​4759/bin/perl---- Bareword "bad" not allowed while "strict subs" in use at tests/bareword_bad.pl line 2. Execution of tests/bareword_bad.pl aborted due to compilation errors.

----EOF ($?='65280')---- ----Output of /usr/local/perl-5.005_61@​4760/bin/perl---- 1bad ----EOF ($?='0')---- ----Output of /usr/local/perl-5.7.1@​11414/bin/perl---- 1bad ----EOF ($?='0')---- ----Output of /usr/local/perl-5.7.1@​11415/bin/perl---- Bareword "bad" not allowed while "strict subs" in use at tests/bareword_bad.pl line 2. Execution of tests/bareword_bad.pl aborted due to compilation errors.

----EOF ($?='65280')----

-- andreas

p5pRT commented 21 years ago

From abe@ztreet.demon.nl

Op een mooie herfstdag (Saturday 07 December 2002 05​:19)\, schreef Michael G Schwern​:

On Fri\, Dec 06\, 2002 at 10​:39​:49PM -0000\, David Wall wrote​:

The code below executes with no errors or warnings; output is '1bad'.

use strict;
use warnings;
print 1\.\.1\, bad;

This has been fixed in 5.8.0.

$ perl5.8.0 -w use strict; use warnings; print 1..1\, bad; Bareword "bad" not allowed while "strict subs" in use at - line 3. Execution of - aborted due to compilation errors.

Shouldn't we add this case to t/lib/strict/subs?

Inline Patch ```diff --- t/lib/strict/subs.orig Sun Dec 8 16:53:58 2002 +++ t/lib/strict/subs Sun Dec 8 16:59:20 2002 @@ -354,3 +354,11 @@ EXPECT Bareword "BAREWORD" not allowed while "strict subs" in use at - line 5. Execution of - aborted due to compilation errors. +######## + +# Ticket: 18927 +use strict 'subs'; +print 1..1, bad; +EXPECT +Bareword "bad" not allowed while "strict subs" in use at - line 4. +Execution of - aborted due to compilation errors. ```

Good luck,

Abe -- [ About the taint pragma proposal ] "Mommy\, mommy\, look! I'm driving my bicycle without my hands!" .... "Mommah\, mommah\, mook! I'm mrivin my micicl mimof my meemh!""   -- Jarkko Hietaniemi on p5p @​ 2001-12-13

p5pRT commented 21 years ago

From @rgs

Abe Timmerman wrote​:

Shouldn't we add this case to t/lib/strict/subs?

Yes\, we should. Thanks\, applied as #18265.

--- t/lib/strict/subs.orig Sun Dec 8 16​:53​:58 2002 +++ t/lib/strict/subs Sun Dec 8 16​:59​:20 2002 @​@​ -354\,3 +354\,11 @​@​ EXPECT Bareword "BAREWORD" not allowed while "strict subs" in use at - line 5. Execution of - aborted due to compilation errors. +######## + +# Ticket​: 18927 +use strict 'subs'; +print 1..1\, bad; +EXPECT +Bareword "bad" not allowed while "strict subs" in use at - line 4. +Execution of - aborted due to compilation errors.

p5pRT commented 21 years ago

@cwest - Status changed from 'open' to 'resolved'