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

Wacky AUTOLOAD/sub inheritance for sub calls on packages with @ISA #3570

Open
p5pRT opened this issue Mar 14, 2001 · 2 comments
Open

Wacky AUTOLOAD/sub inheritance for sub calls on packages with @ISA #3570

p5pRT opened this issue Mar 14, 2001 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 14, 2001

Migrated from rt.perl.org#6028 (status was 'open')

Searchable as RT6028$

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2001

From dsugalski@northernlight.com

Perl inherits AUTOLOAD for sub calls, but doesn't inherit any actual subs,
which can lead to odd situations like this​:

  #! perl -w
 
  package foo;
  @​ISA = qw(bar);
 
  package bar;
  sub baz {print "in baz\n";}
  sub AUTOLOAD {
  print "in here for $AUTOLOAD\n";
  }
 
  package main;
  foo​::baz();
 
Which should throw an error, or possibly print "in baz", but instead prints "in
here for foo​::baz".

We ought to either inherit everything or nothing for sub calls. I'm in the
nothing camp, so a patch to turn the current deprecation warning to an error
shall be forthcoming.
 

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.6.0:

Configured by dsugalski at Mon Nov 20 10:54:31 UTC-5:00 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=VMS, osvers=V7.2-1, archname=VMS_AXP
    uname='VMS monsoon V7.2-1 Compaq AlphaServer GS140 6/700'
    config_args='-des'
    hint=none, useposix=false, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='CC/DECC', optimize='', gccversion=undef
    cppflags='undef'
    ccflags ='/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIAS'
    stdchar='char', d_stdstdio=define, usevfork=true
    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=undef, Off_t='int', lseeksize=4
    alignbytes=8, usemymalloc=N, prototype=define
  Linker and Libraries:
    ld='Link', ldflags ='/NoTrace/NoMap'
    libpth=/sys$share /sys$library
    libs= 
    libc=(DECCRTL), so=exe, useshrplib=undef, libperl=undef
  Dynamic Linking:
    dlsrc=dl_vms.c, dlext=exe, d_dlsymun=undef, ccdlflags=''
    cccdlflags='', lddlflags='/Share'

Locally applied patches:
    VMSSOCK01 - Socket i/o fixes for VMS
    VMSPIPE010 - combined VMS piping revamp
    VMSMISC001 - misc VMS fixes, combined patch


@INC for perl v5.6.0:
    perl_root:[lib.VMS_AXP.5_6_0]
    perl_root:[lib]
    perl_root:[lib.site_perl.VMS_AXP]
    perl_root:[lib.site_perl]
    /perl_root/lib/site_perl
    .


Environment for perl v5.6.0:
    HOME=user01:[dsugalski]
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=user01:[dsugalski]
    PERLSHR=PERL_ROOT:[000000]PERLSHR.EXE
    PERL_BADLANG (unset)
    PERL_ROOT=$80$DKA305:[PERL-5_6_0.]
    SHELL (unset)

1 similar comment
@p5pRT
Copy link
Author

p5pRT commented Mar 22, 2001

From dsugalski@northernlight.com

Perl inherits AUTOLOAD for sub calls, but doesn't inherit any actual subs,
which can lead to odd situations like this​:

  #! perl -w
 
  package foo;
  @​ISA = qw(bar);
 
  package bar;
  sub baz {print "in baz\n";}
  sub AUTOLOAD {
  print "in here for $AUTOLOAD\n";
  }
 
  package main;
  foo​::baz();
 
Which should throw an error, or possibly print "in baz", but instead prints "in
here for foo​::baz".

We ought to either inherit everything or nothing for sub calls. I'm in the
nothing camp, so a patch to turn the current deprecation warning to an error
shall be forthcoming.
 

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.6.0:

Configured by dsugalski at Mon Nov 20 10:54:31 UTC-5:00 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=VMS, osvers=V7.2-1, archname=VMS_AXP
    uname='VMS monsoon V7.2-1 Compaq AlphaServer GS140 6/700'
    config_args='-des'
    hint=none, useposix=false, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='CC/DECC', optimize='', gccversion=undef
    cppflags='undef'
    ccflags ='/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=.obj/NoList/NOANSI_ALIAS'
    stdchar='char', d_stdstdio=define, usevfork=true
    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=undef, Off_t='int', lseeksize=4
    alignbytes=8, usemymalloc=N, prototype=define
  Linker and Libraries:
    ld='Link', ldflags ='/NoTrace/NoMap'
    libpth=/sys$share /sys$library
    libs= 
    libc=(DECCRTL), so=exe, useshrplib=undef, libperl=undef
  Dynamic Linking:
    dlsrc=dl_vms.c, dlext=exe, d_dlsymun=undef, ccdlflags=''
    cccdlflags='', lddlflags='/Share'

Locally applied patches:
    VMSSOCK01 - Socket i/o fixes for VMS
    VMSPIPE010 - combined VMS piping revamp
    VMSMISC001 - misc VMS fixes, combined patch


@INC for perl v5.6.0:
    perl_root:[lib.VMS_AXP.5_6_0]
    perl_root:[lib]
    perl_root:[lib.site_perl.VMS_AXP]
    perl_root:[lib.site_perl]
    /perl_root/lib/site_perl
    .


Environment for perl v5.6.0:
    HOME=user01:[dsugalski]
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=user01:[dsugalski]
    PERLSHR=PERL_ROOT:[000000]PERLSHR.EXE
    PERL_BADLANG (unset)
    PERL_ROOT=$80$DKA305:[PERL-5_6_0.]
    SHELL (unset)

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

2 participants