develooper Front page | perl.perl5.porters | Postings from March 2000

[ID 20000331.006] Inconsistent warnings with "our"

M.J.T. Guy
March 31, 2000 05:52
[ID 20000331.006] Inconsistent warnings with "our"
Message ID:

    perl5.6.0 -we 'my $x; our $x; $x=0'

generate some sort of "redeclared" warning?    The other cases
(two "my"s or two "our"s or "our" before "my") all do.

And is it appropriate that

        perl5.6.0 -we 'our $x'

generates a "used only once", but the corresponding "my" does not?
Particularly since "our" is meant as a replacement for "use vars", and
one of "use vars" purposes is suppression of this warning.

Mike Guy

% perl5.6.0 -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    config_args='-dOes -f'
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
    cc='gcc', optimize='-O', gccversion=
    cppflags='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
    ccflags ='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib -L/opt/local/lib'

Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Mar 24 2000 18:47:00
    . Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About