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

Documentation Error For require Operator #783

Closed
p5pRT opened this issue Oct 25, 1999 · 1 comment
Closed

Documentation Error For require Operator #783

p5pRT opened this issue Oct 25, 1999 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Oct 25, 1999

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

Searchable as RT1710$

@p5pRT
Copy link
Author

p5pRT commented Oct 25, 1999

From James.P.Williams@USAHQ.UnitedSpaceAlliance.com

The perlfunc man page provides a sub that illustrates the behavior of the
require operator. The camel book shows a similar version. There is a bug
in
both models of the operator in how the %INC hash is updated. As written,
recursively require'ing the same $filename would cause infinite recursive
calls
to the require sub. This is because %INC is updated only after the
require'd
file is passed to the do operator. The following patch to perlfunc.pod
changes
the model to correctly assume success for the duration of the do operator,
and
agrees with my reading of how require is actually implemented in pp_ctl.c.

Agreed?

Jim Williams

*** /usr/local/lib/perl5/pod/perlfunc.pod Wed Feb 11 14​:27​:03 1998
--- perlfunc.pod Mon Oct 25 13​:58​:35 1999
***************
*** 2549,2554 ****
--- 2549,2555 ----
  foreach $prefix (@​INC) {
  $realfilename = "$prefix/$filename";
  if (-f $realfilename) {
+ $INC{$filename} = $realfilename;
  $result = do $realfilename;
  last ITER;
  }
***************
*** 2555,2563 ****
  }
  die "Can't find $filename in \@​INC";
  }
  die $@​ if $@​;
  die "$filename did not return true value" unless $result;
- $INC{$filename} = $realfilename;
  $result;
  }
 
--- 2556,2564 ----
  }
  die "Can't find $filename in \@​INC";
  }
+ delete $INC{$filename} if $@​ || !$result;
  die $@​ if $@​;
  die "$filename did not return true value" unless $result;
  $result;
  }
 

Perl Info


Site configuration information for perl 5.00404:

Configured by scotth at Wed Dec  3 09:14:22 PST 1997.

Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=irix, osvers=6.5, archname=irix-n32
    uname='irix hoshi 6.5 11251326 ip22 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=define d_sfio=undef
  Compiler:
    cc='cc -n32 -mips3', optimize='-O3 -mips3', gccversion=
    cppflags='-D_BSD_SIGNALS -D_BSD_TYPES -D_BSD_TIME -OPT:Olimit=0:space=ON
-DLANGUAGE_C -DEMBEDMYMALLOC'
    ccflags ='-D_BSD_SIGNALS -D_BSD_TYPES -D_BSD_TIME -woff 1009,1110,1184
-OPT:Olimit=0:space=ON -DLANGUAGE_C -DEMBEDMYMALLOC'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-n32'
    libpth=/usr/lib32 /lib32
    libs=-lm
    libc=/usr/lib32/libc.so, so=so
    useshrplib=true, libperl=libperl.so.4.4
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=''
    cccdlflags=' ', lddlflags='-n32 -mips3 -shared'

Locally applied patches:
	


@INC for perl 5.00404:
	/usr/share/lib/perl5/irix-n32/5.00404
	/usr/share/lib/perl5
	/usr/share/lib/perl5/site_perl/irix-n32
	/usr/share/lib/perl5/site_perl
	/usr/share/lib/perl5/sgi_perl
	.


Environment for perl 5.00404:
    HOME=/share/williams
    LANG=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
 
PATH=.:/share/williams/bin:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin:/usr/bin/X
11:/ircm/cps/bin:/usr/local/bin:/etc:/usr/etc:/usr/lib:/usr/demos/bin
    PERL_BADLANG (unset)
    SHELL=/bin/csh

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