Perl / perl5

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

$Exporter::Verbose=1 does not work for testing, $Heavy::Verbose is not setting the value to $Exporter::Verbose #6122

Closed p5pRT closed 21 years ago

p5pRT commented 21 years ago

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

Searchable as RT18888$

p5pRT commented 21 years ago

From tangf@eyetap.org

Created by tangf@gamay.madisent.net

# On one line so MakeMaker will see it. require Exporter; our $VERSION = $Exporter​::VERSION; $Carp​::Internal{"Exporter​::Heavy"} = 1; #our $Verbose; our $Verbose = $Exporter​::Verbose;

I had to modify $Verbose so that it inherited the value from $Exporter​::Verbose. I was attempting to see the debug information as specified in several Perl books... but it was never displaying any information. With this change the appropriate information was displayed.

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.8.0: Configured by tangf at Thu Nov 28 12:56:20 EST 2002. Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.18-3, archname=i686-linux uname='linux gamay.madisent.net 2.4.18-3 #1 thu apr 18 07:37:53 edt 2002 i686 unknown ' config_args='-de' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2', cppflags='-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm' ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3 2.96-110)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.2.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl v5.8.0: /usr/local/lib/perl5/5.8.0/i686-linux /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/i686-linux /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl . Environment for perl v5.8.0: HOME=/home/tangf LANG=en_US.iso885915 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/tangf/bin PERL_BADLANG (unset) SHELL=/bin/bash ----------------------------------------- This e-mail has undergone DECONtamination. http://www.deconference.com http://www.eyetap.org ```
p5pRT commented 21 years ago

From @eserte

Felix Tang (via RT) \perlbug\-followup@​perl\.org writes​:

# New Ticket Created by Felix Tang # Please include the string​: [perl #18888] # in the subject line of all future correspondence about this issue. # \<URL​: http​://rt.perl.org/rt2/Ticket/Display.html?id=18888 >

This is a bug report for perl from tangf@​gamay.madisent.net\, generated with the help of perlbug 1.34 running under perl v5.8.0.

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

# On one line so MakeMaker will see it. require Exporter; our $VERSION = $Exporter​::VERSION; $Carp​::Internal{"Exporter​::Heavy"} = 1; #our $Verbose; our $Verbose = $Exporter​::Verbose;

I had to modify $Verbose so that it inherited the value from $Exporter​::Verbose. I was attempting to see the debug information as specified in several Perl books... but it was never displaying any information. With this change the appropriate information was displayed.

Thanks for the report\, though I would fix it slightly different so changing $Exporter​::Verbose will always be reflected in the Exporter​::Heavy parts​:

Inline Patch ```diff --- bleedperl/lib/Exporter/Heavy.pm Thu Oct 10 13:55:07 2002 +++ bleedperl2/lib/Exporter/Heavy.pm Sun Dec 8 01:27:30 2002 @@ -6,7 +6,6 @@ # On one line so MakeMaker will see it. require Exporter; our $VERSION = $Exporter::VERSION; $Carp::Internal{"Exporter::Heavy"} = 1; -our $Verbose; =head1 NAME @@ -103,7 +102,7 @@ } warn "Import ".($remove ? "del":"add").": @names " - if $Verbose; + if $Exporter::Verbose; if ($remove) { foreach $sym (@names) { delete $imports{$sym} } @@ -169,7 +168,7 @@ # barewords twice... both with and without a leading &. # (Technique could be applied to $export_cache at cost of memory) my @expanded = map { /^\w/ ? ($_, '&'.$_) : $_ } @$fail; - warn "${pkg}::EXPORT_FAIL cached: @expanded" if $Verbose; + warn "${pkg}::EXPORT_FAIL cached: @expanded" if $Exporter::Verbose; @{$fail_cache}{@expanded} = (1) x @expanded; } my @failed; @@ -189,7 +188,7 @@ } warn "Importing into $callpkg from $pkg: ", - join(", ",sort @imports) if $Verbose; + join(", ",sort @imports) if $Exporter::Verbose; foreach $sym (@imports) { # shortcut for the common case of no type character ```

Regards,   Slaven

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

Configured by tangf at Thu Nov 28 12​:56​:20 EST 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration​: Platform​: osname=linux\, osvers=2.4.18-3\, archname=i686-linux uname='linux gamay.madisent.net 2.4.18-3 #1 thu apr 18 07​:37​:53 edt 2002 i686 unknown ' config_args='-de' hint=previous\, useposix=true\, d_sigaction=define

usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d\_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n\, bincompat5005=undef

Compiler​: cc='cc'\, ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm'\, optimize='-O2'\, cppflags='-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm' ccversion=''\, gccversion='2.96 20000731 (Red Hat Linux 7.3 2.96-110)'\, gccosandvers='' intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=1234 d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=12 ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8 alignbytes=4\, prototype=define Linker and Libraries​: ld='cc'\, ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.2.5.so\, so=so\, useshrplib=false\, libperl=libperl.a gnulibc_version='2.2.5' Dynamic Linking​: dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags='-rdynamic' cccdlflags='-fpic'\, lddlflags='-shared -L/usr/local/lib'

Locally applied patches​:

--- @​INC for perl v5.8.0​: /usr/local/lib/perl5/5.8.0/i686-linux /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/i686-linux /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .

--- Environment for perl v5.8.0​: HOME=/home/tangf LANG=en_US.iso885915 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset)

PATH=/usr/kerberos/bin​:/usr/local/bin​:/bin​:/usr/bin​:/usr/X11R6/bin​:/home/tangf/bin PERL_BADLANG (unset) SHELL=/bin/bash

----------------------------------------- This e-mail has undergone DECONtamination. http​://www.deconference.com http​://www.eyetap.org

-- Slaven Rezic - slaven.rezic@​berlin.de

  tktimex - project time manager   http​://sourceforge.net/projects/ptktools/

p5pRT commented 21 years ago

From @rgs

Slaven Rezic wrote​:

Thanks for the report\, though I would fix it slightly different so changing $Exporter​::Verbose will always be reflected in the Exporter​::Heavy parts​:

--- bleedperl/lib/Exporter/Heavy.pm Thu Oct 10 13​:55​:07 2002 +++ bleedperl2/lib/Exporter/Heavy.pm Sun Dec 8 01​:27​:30 2002

Thanks\, applied as #18263.

p5pRT commented 21 years ago

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