Perl / perl5

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

package 'vars' not registered for warnings #1682

Closed p5pRT closed 21 years ago

p5pRT commented 24 years ago

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

Searchable as RT2928$

p5pRT commented 24 years ago

From kompas@kompas.usr.onet.pl

Created by kompas@onet.pl

Trying to declare globals with "vars" pragma\, when one make very common mistake of using comma in qw() qouting\, like this​:

perl -le 'use vars qw($aaa\, $bbb)'

one will get very cryptic message​:

package 'vars' not registered for warnings at -e line 1 BEGIN failed--compilation aborted at -e line 1.

Actually\, this should do nothing special (just remove comma from "$aaa\,").

Fixup is very simple (although I'm not sure this is The Right Way\, I just checked warnings man page and checked that this works)​:

Inline Patch ```diff --- vars.pm.old Fri Mar 31 22:57:29 2000 +++ vars.pm Fri Mar 31 22:57:36 2000 @@ -8,7 +8,7 @@ # if Carp hasn't been loaded in earlier compile time. :-( # We'll let those bugs get found on the development track. require Carp if $] < 5.00450; -use warnings::register(); +use warnings::register; sub import { ```

[Please do not change anything below this line] ----------------------------------------------------------------- --- Flags​:   category=library   severity=medium --- Site configuration information for perl v5.6.0​:

Configured by oa at Fri Mar 31 08​:52​:06 MET DST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​:   Platform​:   osname=solaris\, osvers=2.7\, archname=sun4-solaris   uname='sunos md.onet.pl 5.7 generic_106541-07 sun4u sparc sunw\,ultra-enterprise '   config_args=''   hint=recommended\, 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   Compiler​:   cc='gcc'\, optimize='-O'\, gccversion=2.95.2 19991024 (release)   cppflags='-fno-strict-aliasing -I/usr/local/include'   ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'   stdchar='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=8   alignbytes=8\, usemymalloc=y\, prototype=define   Linker and Libraries​:   ld='gcc'\, ldflags =' -L/usr/local/lib '   libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib   libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec   libc=/lib/libc.so\, 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'

Locally applied patches​:  

--- @​INC for perl v5.6.0​:   /portal/oa/lib/perl5/5.6.0/sun4-solaris   /portal/oa/lib/perl5/5.6.0   /portal/oa/lib/perl5/site_perl/5.6.0/sun4-solaris   /portal/oa/lib/perl5/site_perl/5.6.0   /portal/oa/lib/perl5/site_perl   .

--- Environment for perl v5.6.0​:   HOME=/portal/oa   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/portal/oa/bin​:/usr/local/bin​:/usr/ccs/bin​:/usr/local/bin​:/usr/ccs/bin​:/bin​:/usr/bin​:/usr/ucb​:/usr/bin/X11​:/usr/local/bin​:/usr/local/bin   PERL_BADLANG (unset)   SHELL=/bin/bash env-end To​: perlbug@​perl.com Subject​: package 'vars' not registered for warnings Reply-To​: kompas@​onet.pl

This is a bug report for perl from kompas@​onet.pl\, generated with the help of perlbug 1.28 running under perl v5.6.0.

----------------------------------------------------------------- [Please enter your report here]

Trying to declare globals with "vars" pragma\, when one make very common mistake of using comma in qw() qouting\, like this​:

perl -le 'use vars qw($aaa\, $bbb)'

one will get very cryptic message​:

package 'vars' not registered for warnings at -e line 1 BEGIN failed--compilation aborted at -e line 1.

Actually\, this should do nothing special (just remove comma from "$aaa\,").

Fixup is very simple (although I'm not sure this is The Right Way\, I just checked warnings man page and checked that this works)​:

Inline Patch ```diff --- vars.pm.old Fri Mar 31 22:57:29 2000 +++ vars.pm Fri Mar 31 22:57:36 2000 @@ -8,7 +8,7 @@ # if Carp hasn't been loaded in earlier compile time. :-( # We'll let those bugs get found on the development track. require Carp if $] < 5.00450; -use warnings::register(); +use warnings::register; sub import { ```
Perl Info ``` Flags: category=library severity=medium Site configuration information for perl v5.6.0: Configured by oa at Fri Mar 31 08:52:06 MET DST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.7, archname=sun4-solaris uname='sunos md.onet.pl 5.7 generic_106541-07 sun4u sparc sunw,ultra-enterprise ' config_args='' hint=recommended, 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 Compiler: cc='gcc', optimize='-O', gccversion=2.95.2 19991024 (release) cppflags='-fno-strict-aliasing -I/usr/local/include' ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='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=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec libc=/lib/libc.so, 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' Locally applied patches: @INC for perl v5.6.0: /portal/oa/lib/perl5/5.6.0/sun4-solaris /portal/oa/lib/perl5/5.6.0 /portal/oa/lib/perl5/site_perl/5.6.0/sun4-solaris /portal/oa/lib/perl5/site_perl/5.6.0 /portal/oa/lib/perl5/site_perl . Environment for perl v5.6.0: HOME=/portal/oa LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/portal/oa/bin:/usr/local/bin:/usr/ccs/bin:/usr/local/bin:/usr/ccs/bin:/bin:/usr/bin:/usr/ucb:/usr/bin/X11:/usr/local/bin:/usr/local/bin PERL_BADLANG (unset) SHELL=/bin/bash env-end ```
p5pRT commented 23 years ago

From The RT System itself

Confirmed in 5.6.0 -- MJD

p5pRT commented 21 years ago

From @floatingatoll

[kompas@​kompas.usr.onet.pl - Fri Mar 31 05​:03​:41 2000]​:

This is a bug report for perl from kompas@​onet.pl\, generated with the help of perlbug 1.28 running under perl v5.6.0.

Trying to declare globals with "vars" pragma\, when one make very common mistake of using comma in qw() qouting\, like this​:

perl -le 'use vars qw($aaa\, $bbb)'

one will get very cryptic message​:

package 'vars' not registered for warnings at -e line 1 BEGIN failed--compilation aborted at -e line 1.

As of the 5.8/5.9 development branch\, this has been fixed. Thanks for the bug report :)

- R.

grep warnings​::register **/vars.pm use warnings​::register;

perl -le 'use vars qw($aaa\, $bbb)' echo $? 0

p5pRT commented 21 years ago

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