Bug in Perl 5.000 strict vars pragma 
Author Message
 Bug in Perl 5.000 strict vars pragma

I think I've found an anomaly in the  "strict vars" compiler directive
in Perl 5.000.  Consider the following program:

        package Foo;
        use strict;
        $Foo::Bar = 1;
        $Bar = 1;
        print "OK\n";

When I run this with perl 5.000 I get:

        OK

However, why  is it not complaining about  line 4,  with the un-strict
notation?  If I comment line 3, it correctly warns of the notation:

        Global symbol "Bar" requires explicit package name at Test.pm line 4.
        Execution of Test.pm aborted due to compilation errors.

I'd really like for  the "strict vars" directive  to warn me  of *all*
non-fully-qualified globals, not just those   that have not been  used
yet.

                                                Doug Campbell

P.S.  Here's myconfig:

Summary of my perl5 (patchlevel 0) configuration:
  Platform:
    osname=sunos, osver=4.1.3, archname=sun4-sunos
    uname='sunos splat 4.1.3 1 sun4m '
    hint=recommended
  Compiler:
    cc='cc', optimize='-O'
    cppflags=''
    ccflags =''
    ldflags =''
    stdchar='unsigned char', d_stdstdio=define, usevfork=true
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=31
  Libraries:
    so=so
    libpth=/lib /usr/lib /usr/ucblib /usr/local/lib
    libs=-lnsl -lgdbm -ldbm -ldl -lm -lc -lposix
    libc=/usr/lib/libc.so.1.8
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef
    cccdlflags='-pic', ccdlflags='', lddlflags=''



Sun, 20 Apr 1997 00:23:13 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. PERL 5.000 bug report (FORMATs from 4.036 to 5.000)

2. perl5.00 strict vars bug

3. use vars pragma with file handle?

4. Question on the "use strict" pragma

5. possible bug: what=bug in h2ph platform=solaris2.4 perlversion=5.000

6. Question on the "use strict" pragma

7. strict pragma and G::Image::newFromGif(FILEHANDLE)

8. Problem with 'use strict' pragma

9. MIME::Lite Attach Method and Strict Pragma

10. Reporting bugs in Perl 5.000

11. perl 5.000 install bug

12. perl 5.000 install bug

 

 
Powered by phpBB® Forum Software