Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heuristics in base.pm #341

Closed
p5pRT opened this issue Aug 4, 1999 · 2 comments
Closed

heuristics in base.pm #341

p5pRT opened this issue Aug 4, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 4, 1999

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

Searchable as RT1172$

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 1999

From ajh@doughboy.formovies.com

base.pm doesn't deal well with class hierarchies of the form​:

  Foo.pm​:
  package Foo;

  Foo/Bar.pm
  package Foo​::Bar;
  use base 'Foo';

The problem seems to be in the way base.pm checks whether Foo.pm
has been loaded​:

  unless (defined %{"$base\​::"}) {

But as soon as C<require Foo​::Bar>, a 'Bar​::' entry is
added to %Foo​::.

It seems like a check against %INC would be more reliable, and
would cheer up anyone who doesn't want to see 'defined' used
on hashes. But base.pm seems very interested in the contents
of %{"$base\​::"} (it checks it again after the 'require' a
couple lines later, so I'm not sure enough in the %INC fix
to send in a patch.

Does the %INC check sound reasonable? Should I send in a patch,
or would you rather someone more competent did it?

Perl Info


Site configuration information for perl 5.00502:

Configured by ajh at Sat Oct 17 22:33:23 PDT 1998.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=linux, osvers=2.0.34, archname=i686-linux-thread
    uname='linux doughboy.rtk.com 2.0.34 #7 sat oct 17 19:11:23 pdt 1998 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL'
    ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  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 5.00502:
    /usr/lib/perl5/5.00502/i686-linux-thread
    /usr/lib/perl5/5.00502
    /usr/lib/perl5/site_perl/5.005/i686-linux-thread
    /usr/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00502:
    HOME=/dp/usr/ajh
    LANG (unset)
    LD_LIBRARY_PATH=/usr/lib:/u01/app/oracle/product/8.0.5/lib
    LOGDIR (unset)
    PATH=/sbin:/usr/sbin:/opt/kde/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/ajh/SmallEiffel/bin:/u01/app/oracle/product/8.0.5/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 1999

From @andk

On Wed, 4 Aug 1999 18​:57​:26 -0700, Aaron Harsh <ajh@​doughboy.formovies.com> said​:

This is a bug report for perl from ajh@​doughboy.rtk.com,
generated with the help of perlbug 1.26 running under perl 5.00502.

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

base.pm doesn't deal well with class hierarchies of the form​:

Foo\.pm&#8203;:
    package Foo;
Foo/Bar\.pm
    package Foo&#8203;::Bar;
    use base 'Foo';

The problem seems to be in the way base.pm checks whether Foo.pm
has been loaded​:

unless \(defined %\{"$base\\&#8203;::"\}\) \{

But as soon as C<require Foo​::Bar>, a 'Bar​::' entry is
added to %Foo​::.

It seems like a check against %INC would be more reliable, and
would cheer up anyone who doesn't want to see 'defined' used
on hashes. But base.pm seems very interested in the contents
of %{"$base\​::"} (it checks it again after the 'require' a
couple lines later, so I'm not sure enough in the %INC fix
to send in a patch.

Does the %INC check sound reasonable? Should I send in a patch,
or would you rather someone more competent did it?

Thanks for your report and offer. The problem has been addressed in
the development release (currently 5.005_60) by tweaking $VERSION in
the involved packages.

--
andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant