Perl / perl5

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

"perl 5.005, patch 03" perldoc banner #1663

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

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

Searchable as RT2905$

p5pRT commented 24 years ago

From joseph@dixie.cscaper.com

Created by joseph@dixie.cscaper.com

The banners (at least the ones I've noticed) on my 5.6.0 man pages say

  23/Mar/2000 perl 5.005\, patch 03 1

when I read them with perldoc.

I wonder if this is occurring because somewhere in the chain of subprograms being run by perldoc\, the wrong perl is being called. My feeling has always been that the various perl utilities should use the perl that is running them (via Config presumably)\, not one that might be found somewhere in the path. Same for calling other perl utilities.

I'm invoking the correct perl and perldoc at the start​:

/usr/local/devel/perl-longlong/bin/perldoc perl

or

/usr/local/devel/perl-longlong/bin/perldoc pod/perl.pod

I'm not quite sure where it's going awry.

  -joseph

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.6.0: Configured by joseph at Thu Mar 23 23:02:23 MST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=linux, osvers=2.2.12-20, archname=i586-linux-64all uname='linux dixie.cscaper.com 2.2.12-20 #1 mon sep 27 10:25:54 edt 1999 i586 unknown ' config_args='-d' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=define use64bitall=define uselongdouble=define usesocks=undef Compiler: cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) cppflags='-fno-strict-aliasing -I/usr/local/include' ccflags ='-fno-strict-aliasing -I/usr/local/include' 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 ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=4 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 -lc -lposix -lcrypt libc=/lib/libc-2.1.2.so, 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 v5.6.0: /usr/local/devel/perl-longlong/lib/5.5.670/i586-linux-64all /usr/local/devel/perl-longlong/lib/5.5.670 /usr/local/devel/perl-longlong/lib/site_perl/5.5.670/i586-linux-64all /usr/local/devel/perl-longlong/lib/site_perl/5.5.670 /usr/local/devel/perl-longlong/lib/site_perl/5.5.670 . Environment for perl v5.6.0: HOME=/home/joseph LANG=en_US LANGUAGE (unset) LC_ALL=en_US LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib:/oracle/sw/lib LOGDIR (unset) PATH=/bin:/usr/bin:/home/joseph/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/frame/bin:/usr/local/mysql/bin:/oracle/sw/bin:/usr/sbin:/usr/games:. PERL_BADLANG (unset) SHELL=/bin/tcsh ```
p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

"Joseph N. Hall" \joseph@​dixie\.cscaper\.com wrote

The banners (at least the ones I've noticed) on my 5.6.0 man pages say

23/Mar/2000 perl 5.005\, patch 03 1

when I read them with perldoc.

I wonder if this is occurring because somewhere in the chain of subprograms being run by perldoc\, the wrong perl is being called.

Not quite - actually it's calling the wrong version of pod2man. So you'll find it makes a right mess of\, e.g. "perldoc -f open" because it doesn't know about those new-fangled C\<\< ... >> thingies.

Patch (for 5.6.0) attached. Since it drags in File​::Spec\, I also took the opportunity of eliminating the various /-is-the-dir-separator assumptions.

Mike Guy

Inline Patch ```diff --- ./utils/perldoc.PL.orig Fri Mar 31 18:04:46 2000 +++ ./utils/perldoc.PL Fri Mar 31 18:18:01 2000 @@ -38,6 +38,7 @@ my \@pagers = (); push \@pagers, "$Config{'pager'}" if -x "$Config{'pager'}"; +my \$bindir = "$Config{installscript}"; !GROK!THIS! @@ -48,6 +49,7 @@ use Fcntl; # for sysopen use Getopt::Std; use Config '%Config'; +use File::Spec::Functions qw(catfile splitdir); # # Perldoc revision #1 -- look up a piece of documentation in .pod format that @@ -223,7 +225,7 @@ sub minus_f_nocase { my($dir,$file) = @_; - my $path = join('/',$dir,$file); # XXX: dirseps + my $path = catfile($dir,$file); return $path if -f $path and -r _; if (!$opt_i or $Is_VMS or $Is_MSWin32 or $Is_Dos or $^O eq 'os2') { # on a case-forgiving file system or if case is important @@ -237,13 +239,13 @@ local($")="/"; my @p = ($dir); my($p,$cip); - foreach $p (split(m!/!, $file)){ # XXX: dirseps - my $try = "@p/$p"; + foreach $p (splitdir $file){ + my $try = catfile @p, $p; stat $try; if (-d _) { push @p, $p; if ( $p eq $global_target) { - my $tmp_path = join ('/', @p); # XXX: dirseps + my $tmp_path = catfile @p; my $path_f = 0; for (@global_found) { $path_f = 1 if $_ eq $tmp_path; @@ -302,7 +304,7 @@ my $ret; my $i; my $dir; - $global_target = (split(m!/!, $s))[-1]; # XXX: dirseps + $global_target = (splitdir $s)[-1]; # XXX: why not use File::Basename? for ($i=0; $i<@dirs; $i++) { $dir = $dirs[$i]; ($dir = VMS::Filespec::unixpath($dir)) =~ s!/\z!! if $Is_VMS; @@ -325,10 +327,10 @@ if ($recurse) { opendir(D,$dir) or die "Can't opendir $dir: $!"; - my @newdirs = map "$dir/$_", grep { # XXX: dirseps + my @newdirs = map catfile($dir, $_), grep { not /^\.\.?\z/s and not /^auto\z/s and # save time! don't search auto dirs - -d "$dir/$_" # XXX: dirseps + -d catfile($dir, $_) } readdir D; closedir(D) or die "Can't closedir $dir: $!"; next unless @newdirs; @@ -362,7 +364,7 @@ close OUT or die "can't close $tmp: $!"; } elsif (not $opt_u) { - my $cmd = "pod2man --lax $file | $opt_n -man"; + my $cmd = catfile($bindir, 'pod2man') . " --lax $file | $opt_n -man"; $cmd .= " | col -x" if $^O =~ /hpux/; my $rslt = `$cmd`; $rslt = filter_nroff($rslt) if $filter; @@ -425,8 +427,7 @@ my @found; foreach (@pages) { if ($podidx && open(PODIDX, $podidx)) { - my $searchfor = $_; - $searchfor =~ s,::,/,g; # XXX: dirseps + my $searchfor = catfile split '::'; print STDERR "Searching for '$searchfor' in $podidx\n" if $opt_v; local $_; while () { End of patch ```
p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

Test message - please ignore

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

"M.J.T. Guy" wrote​:

Test message - please ignore a reply from me this time