Change 19193 by [EMAIL PROTECTED] on 2003/04/12 18:46:31
Integrate:
[ 19166]
Subject: [PATCH pod/perlpod.pod] was RE: How cross-platform is `foo 2>&1`
these days?
From: Robin Barker <[EMAIL PROTECTED]>
Date: Tue, 8 Apr 2003 14:23:04 +0100
Message-ID: <[EMAIL PROTECTED]>
[ 19167]
Typos fixes by Stas Bekman.
[ 19168]
Document that perl recognizes 2>&1 on the command-line on VMS.
[ 19171]
Implement support for --help and --version in Getopt::Std
Subject: Re: [PATCH 5.8.1 @19053] Getopt::Std
From: Ilya Zakharevich <[EMAIL PROTECTED]>
Date: Mon, 7 Apr 2003 17:07:15 -0700
Message-ID: <[EMAIL PROTECTED]>
[ 19172]
Try to be more descriptive than just __ANONIO__ which is what
you get when you autovivify filehandles into array/hash elements.
[ 19173]
open(my $fh, ">&", STDOUT) should not warn under strict.
[ 19174]
Even more promotion for -lc128 (long doubles on AIX)
More obvious detection of C compiler
cc_type should not promote to config.sh
From: "H.Merijn Brand" <[EMAIL PROTECTED]>
Date: Wed, 09 Apr 2003 14:31:48 +0200
Message-Id: <[EMAIL PROTECTED]>
[ 19175]
In case someone is using UTF-8 locales.
[ 19176]
Also locale names can contain illegal UTF-8.
[ 19177]
perlport information about portably embedding string data.
[ 19179]
I assume the idea was to use the *cwd variables for testing.
[ 19180]
With AFS the cwds have little chance of agreeing.
[ 19181]
Unless Inuits are involved...
[ 19183]
The test doesn't work that well when -Uusedl.
Some of the tests could be salvaged even then I guess.
[ 19184]
Add an option for the grok_xxx() to silently ignore bad digits.
[ 19185]
Noted by Nat: -0 didn't work that well with Unicode.
[ 19186]
Be more descriptive.
[ 19188]
PerlFAQ sync.
[ 19189]
Peter Scott suggests that the docs for base.pm should
state explicitely that base.pm doesn't call import()
on base classes. Plus a few typos.
[ 19190]
Subject: [PATCH] MakeMaker 6.10_02 -> 6.10_03
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Fri, 11 Apr 2003 00:32:02 -0700
Message-ID: <[EMAIL PROTECTED]>
[ 19191]
Benchmark nit from Nick Clark (in OpenBSD the result could
be a negative zero, -0).
Affected files ...
... //depot/maint-5.8/perl/MANIFEST#46 integrate
... //depot/maint-5.8/perl/cv.h#7 integrate
... //depot/maint-5.8/perl/doio.c#12 integrate
... //depot/maint-5.8/perl/ext/B/t/deparse.t#5 integrate
... //depot/maint-5.8/perl/ext/Cwd/t/cwd.t#2 integrate
... //depot/maint-5.8/perl/hints/aix.sh#8 integrate
... //depot/maint-5.8/perl/lib/Benchmark.t#3 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/MM_Any.pm#4 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/MM_MacOS.pm#4 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/MM_Unix.pm#5 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/MM_VMS.pm#5 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/MakeMaker.pm#4 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/TODO#3 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/t/00compile.t#3 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/t/00setup_dummy.t#3 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/t/Constant.t#3 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/t/Installed.t#3 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/t/basic.t#4 integrate
... //depot/maint-5.8/perl/lib/ExtUtils/t/zz_cleanup_dummy.t#2 integrate
... //depot/maint-5.8/perl/lib/Getopt/Std.pm#2 integrate
... //depot/maint-5.8/perl/lib/attributes.pm#2 integrate
... //depot/maint-5.8/perl/lib/base.pm#2 integrate
... //depot/maint-5.8/perl/lib/locale.t#2 integrate
... //depot/maint-5.8/perl/numeric.c#5 integrate
... //depot/maint-5.8/perl/op.c#20 integrate
... //depot/maint-5.8/perl/perl.c#28 integrate
... //depot/maint-5.8/perl/perl.h#24 integrate
... //depot/maint-5.8/perl/pod/perlfaq.pod#5 integrate
... //depot/maint-5.8/perl/pod/perlfaq3.pod#5 integrate
... //depot/maint-5.8/perl/pod/perlfaq4.pod#6 integrate
... //depot/maint-5.8/perl/pod/perlfaq7.pod#5 integrate
... //depot/maint-5.8/perl/pod/perlfaq9.pod#4 integrate
... //depot/maint-5.8/perl/pod/perlpod.pod#2 integrate
... //depot/maint-5.8/perl/pod/perlport.pod#6 integrate
... //depot/maint-5.8/perl/pod/perlrun.pod#16 integrate
... //depot/maint-5.8/perl/sv.h#14 integrate
... //depot/maint-5.8/perl/t/io/open.t#3 integrate
... //depot/maint-5.8/perl/vms/perlvms.pod#3 integrate
Differences ...
==== //depot/maint-5.8/perl/MANIFEST#46 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#45~19165~ Tue Apr 8 10:43:04 2003
+++ perl/MANIFEST Sat Apr 12 11:46:31 2003
@@ -2722,7 +2722,7 @@
t/run/runenv.t Test if perl honors its environment variables.
t/run/switcha.t Test the -a switch
t/run/switchC.t Test the -C switch
-t/run/switches.t Tests for the other switches
+t/run/switches.t Tests for the other switches (-0, -l, -c, -s, -M, -m,
-V)
t/run/switchF.t Test the -F switch
t/run/switchI.t Test the -I switch
t/run/switchn.t Test the -n switch
==== //depot/maint-5.8/perl/cv.h#7 (text) ====
Index: perl/cv.h
--- perl/cv.h#6~18804~ Sun Mar 2 08:22:35 2003
+++ perl/cv.h Sat Apr 12 11:46:31 2003
@@ -7,7 +7,7 @@
*
*/
-/* This structure much match XPVCV in B/C.pm and the beginning of XPVFM
+/* This structure must match XPVCV in B/C.pm and the beginning of XPVFM
* in sv.h */
struct xpvcv {
==== //depot/maint-5.8/perl/ext/Cwd/t/cwd.t#2 (text) ====
Index: perl/ext/Cwd/t/cwd.t
--- perl/ext/Cwd/t/cwd.t#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/ext/Cwd/t/cwd.t Sat Apr 12 11:46:31 2003
@@ -60,16 +60,18 @@
# DCL SHOW DEFAULT has leading spaces
$start =~ s/^\s+// if $IsVMS;
SKIP: {
- skip "'$pwd_cmd' failed, nothing to test against", 4 if $?;
+ skip("'$pwd_cmd' failed, nothing to test against", 4) if $?;
+ skip("/afs seen, paths unlikely to match", 4) if $start =~ m|/afs/|;
my $cwd = cwd;
my $getcwd = getcwd;
my $fastcwd = fastcwd;
my $fastgetcwd = fastgetcwd;
- is(cwd(), $start, 'cwd()');
- is(getcwd(), $start, 'getcwd()');
- is(fastcwd(), $start, 'fastcwd()');
- is(fastgetcwd(),$start, 'fastgetcwd()');
+
+ is($cwd, $start, 'cwd()');
+ is($getcwd, $start, 'getcwd()');
+ is($fastcwd, $start, 'fastcwd()');
+ is($fastgetcwd, $start, 'fastgetcwd()');
}
}
==== //depot/maint-5.8/perl/hints/aix.sh#8 (text) ====
Index: perl/hints/aix.sh
--- perl/hints/aix.sh#7~19123~ Tue Apr 1 08:38:55 2003
+++ perl/hints/aix.sh Sat Apr 12 11:46:31 2003
@@ -134,8 +134,8 @@
# Changes for dynamic linking by Wayne Scott <[EMAIL PROTECTED]>
#
# Tell perl which symbols to export for dynamic linking.
-cccdlflags='none' # All AIX code is position independent
-cc_type=xlc
+cccdlflags='none' # All AIX code is position independent
+ cc_type=xlc # do not export to config.sh
case "$cc" in
*gcc*)
cc_type=gcc
@@ -145,9 +145,9 @@
gccversion=`$cc --version | sed 's/.*(GCC) *//`
fi
;;
-*) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -v '\.msg\.[A-Za-z_]*\.' |
awk '{print $2}'`
+*) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -v '\.msg\.[A-Za-z_]*\.' |
awk '{print $1,$2}'`
case "$ccversion" in
- '') ccversion=`lslpp -L | grep 'IBM C and C++ Compilers LUM$' | awk '{print $2}'`
+ '') ccversion=`lslpp -L | grep 'IBM C and C++ Compilers LUM$'`
;;
*.*.*.*.*.*.*) # Ahhrgg, more than one C compiler installed
first_cc_path=`which ${cc:-cc}`
@@ -164,9 +164,13 @@
fi
;;
esac
- ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -i $cc_type | awk
'{print $2}' | head -1`
+ ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -i $cc_type | head -1`
+ ;;
+ vac*.*.*.*)
+ cc_type=vac
;;
esac
+ ccversion=`echo "$ccversion" | awk '{print $2}'`
case "$ccversion" in
3.6.6.0)
optimize='none'
@@ -209,6 +213,20 @@
# the required -bE:$installarchlib/CORE/perl.exp is added by
# libperl.U (Configure) later.
+# The first 3 options would not be needed if dynamic libs. could be linked
+# with the compiler instead of ld.
+# -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary
+# -bE:$(BASEEXT).exp Export these symbols. This file contains only one
+# symbol: boot_$(EXP) can it be auto-generated?
+case "$osvers" in
+ 3*)
+ lddlflags="$lddlflags -H512 -T512 -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp
-bE:\$(BASEEXT).exp -e _nostart -lc"
+ ;;
+ *)
+ lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp
-bE:\$(BASEEXT).exp -bnoentry -lc"
+ ;;
+ esac
+
case "$use64bitall" in
$define|true|[yY]*) use64bitint="$define" ;;
esac
@@ -223,6 +241,7 @@
$define|true|[yY]*)
ccflags="$ccflags -qlongdouble"
libswanted="c128 $libswanted"
+ lddlflags=`echo "$lddlflags " | sed -e 's/ -lc / -lc128 -lc /'`
;;
esac
esac
@@ -257,19 +276,6 @@
'') ldlibpthname=LIBPATH ;;
esac
-# The first 3 options would not be needed if dynamic libs. could be linked
-# with the compiler instead of ld.
-# -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary
-# -bE:$(BASEEXT).exp Export these symbols. This file contains only one
-# symbol: boot_$(EXP) can it be auto-generated?
-case "$osvers" in
-3*)
- lddlflags="$lddlflags -H512 -T512 -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp
-bE:\$(BASEEXT).exp -e _nostart -lc"
- ;;
-*)
- lddlflags="$lddlflags -bhalt:4 -bM:SRE -bI:\$(PERL_INC)/perl.exp
-bE:\$(BASEEXT).exp -bnoentry -lc"
- ;;
-esac
# AIX 4.2 (using latest patchlevels on 20001130) has a broken bind
# library (getprotobyname and getprotobynumber are outversioned by
# the same calls in libc, at least for xlc version 3...
==== //depot/maint-5.8/perl/lib/Benchmark.t#3 (text) ====
Index: perl/lib/Benchmark.t
--- perl/lib/Benchmark.t#2~18080~ Sun Nov 3 21:23:04 2002
+++ perl/lib/Benchmark.t Sat Apr 12 11:46:31 2003
@@ -292,8 +292,8 @@
(my $fastslow = $fastslowt) =~ s!%!!;
if ($slowrate < $fastrate) {
pass ("slow rate is less than fast rate");
- unless (ok ($slowfast < 0 && $slowfast >= -100,
- "slowfast should be less than zero, and >= -100")) {
+ unless (ok ($slowfast <= 0 && $slowfast >= -100,
+ "slowfast should be less than or equal to zero, and >= -100")) {
print STDERR "# slowfast $slowfast\n";
$all_passed = 0;
}
==== //depot/maint-5.8/perl/lib/ExtUtils/MM_Any.pm#4 (text) ====
Index: perl/lib/ExtUtils/MM_Any.pm
--- perl/lib/ExtUtils/MM_Any.pm#3~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/MM_Any.pm Sat Apr 12 11:46:31 2003
@@ -557,6 +557,11 @@
sub metafile_target {
my $self = shift;
+ return <<'MAKE_FRAG' if $self->{NO_META};
+metafile:
+ $(NOECHO) $(NOOP)
+MAKE_FRAG
+
my $prereq_pm = '';
while( my($mod, $ver) = each %{$self->{PREREQ_PM}} ) {
$prereq_pm .= sprintf " %-30s %s\n", "$mod:", $ver;
@@ -593,6 +598,11 @@
sub metafile_addtomanifest_target {
my $self = shift;
+
+ return <<'MAKE_FRAG' if $self->{NO_META};
+metafile_addtomanifest:
+ $(NOECHO) $(NOOP)
+MAKE_FRAG
my $add_meta = $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']);
maniadd({q{META.yml} => q{Module meta-data in YAML}});
==== //depot/maint-5.8/perl/lib/ExtUtils/MM_MacOS.pm#4 (text) ====
Index: perl/lib/ExtUtils/MM_MacOS.pm
--- perl/lib/ExtUtils/MM_MacOS.pm#3~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/MM_MacOS.pm Sat Apr 12 11:46:31 2003
@@ -265,7 +265,7 @@
}
push(@mac, $_);
}
-
+
return "@mac";
}
@@ -278,7 +278,8 @@
sub patternify {
my($unix) = @_;
my(@mac);
-
+ use bytes; # Non-UTF-8 high bytes below.
+
foreach (split(/[ \t\n]+/, $unix)) {
if (m|/|) {
$_ = ":$_";
@@ -288,7 +289,7 @@
push(@mac, $_);
}
}
-
+
return "@mac";
}
==== //depot/maint-5.8/perl/lib/ExtUtils/MM_Unix.pm#5 (text) ====
Index: perl/lib/ExtUtils/MM_Unix.pm
--- perl/lib/ExtUtils/MM_Unix.pm#4~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/MM_Unix.pm Sat Apr 12 11:46:31 2003
@@ -743,8 +743,8 @@
ci :
$(PERLRUN) "-MExtUtils::Manifest=maniread" \\
-e "@all = keys %{ maniread() };" \\
- -e "print("Executing $(CI) @all\n"); system(qq{$(CI) @all});" \\
- -e "print("Executing $(RCS_LABEL) ...\n"); system(qq{$(RCS_LABEL) @all});"
+ -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \\
+ -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});"
};
}
@@ -1199,8 +1199,11 @@
# To avoid using the unportable 2>&1 to supress STDERR,
# we close it before running the command.
close STDERR if $stderr_duped;
- $val = `$abs -e "require $ver; print qq{VER_OK\n}"`;
+ my $version_check = qq{$abs -e "require $ver; print qq{VER_OK\n}"};
+ $val = `$version_check`;
open STDERR, '>&STDERR_COPY' if $stderr_duped;
+ print STDERR "Perl version check failed: '$version_check'\n"
+ unless defined $val;
if ($val =~ /^VER_OK/) {
print "Using PERL=$abs\n" if $trace;
@@ -1507,6 +1510,7 @@
}
return if /\#/;
return if /~$/; # emacs temp files
+ return if /,v$/; # RCS files
my $path = $File::Find::name;
my $prefix = $self->{INST_LIBDIR};
@@ -1608,7 +1612,7 @@
my($manpagename) = $name;
$manpagename =~ s/\.p(od|m|l)\z//;
# everything below lib is ok
- if($self->{PARENT_NAME} && $manpagename !~ s!^\W*lib\W+!!s) {
+ unless($manpagename =~ s!^\W*lib\W+!!s) {
$manpagename = $self->catfile(
split(/::/,$self->{PARENT_NAME}),$manpagename
);
@@ -3801,7 +3805,7 @@
push(@m, map("\t\$(NOECHO) cd $_ && \$(TEST_F) \$(FIRST_MAKEFILE) && \$(MAKE)
test \$(PASTHRU)\n", @{$self->{DIR}}));
}
- push(@m, "\t\$(NOECHO) $(ECHO) 'No tests defined for \$(NAME) extension.'\n")
+ push(@m, "\t\$(NOECHO) \$(ECHO) 'No tests defined for \$(NAME) extension.'\n")
unless $tests or -f "test.pl" or @{$self->{DIR}};
push(@m, "\n");
==== //depot/maint-5.8/perl/lib/ExtUtils/MM_VMS.pm#5 (text) ====
Index: perl/lib/ExtUtils/MM_VMS.pm
--- perl/lib/ExtUtils/MM_VMS.pm#4~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/MM_VMS.pm Sat Apr 12 11:46:31 2003
@@ -21,7 +21,7 @@
use File::Basename;
use vars qw($Revision @ISA $VERSION);
($VERSION) = '5.67';
-($Revision = substr(q$Revision: 1.89 $, 10)) =~ s/\s+$//;
+($Revision = substr(q$Revision: 1.91 $, 10)) =~ s/\s+$//;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@@ -1603,7 +1603,7 @@
$(NOECHO) $(ECHO) "the appropriate files. Sorry for the inconvenience."
uninstall_from_sitedirs ::
- $(NOECHO) $(UNINSTALL)
],$self->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist'),"\n",q[
+ $(NOECHO) $(UNINSTALL)
].$self->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[
$(NOECHO) $(ECHO) "Uninstall is now deprecated and makes no actual changes."
$(NOECHO) $(ECHO) "Please check the list above carefully for errors, and
manually remove"
$(NOECHO) $(ECHO) "the appropriate files. Sorry for the inconvenience."
@@ -2232,7 +2232,14 @@
$self->{EXPORT_LIST} ||= '$(BASEEXT).opt';
my $shr = $Config{dbgprefix} . 'PERLSHR';
- $self->{PERL_ARCHIVE} ||= $self->catfile($self->{PERL_SRC},
"$shr.$Config{'dlext'}");
+ if ($self->{PERL_SRC}) {
+ $self->{PERL_ARCHIVE} ||=
+ $self->catfile($self->{PERL_SRC}, "$shr.$Config{'dlext'}");
+ }
+ else {
+ $self->{PERL_ARCHIVE} ||=
+ $ENV{$shr} ? $ENV{$shr} : "Sys\$Share:$shr.$Config{'dlext'}";
+ }
$self->{PERL_ARCHIVE_AFTER} ||= '';
}
==== //depot/maint-5.8/perl/lib/ExtUtils/MakeMaker.pm#4 (text) ====
Index: perl/lib/ExtUtils/MakeMaker.pm
--- perl/lib/ExtUtils/MakeMaker.pm#3~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/MakeMaker.pm Sat Apr 12 11:46:31 2003
@@ -2,8 +2,8 @@
BEGIN {require 5.005_03;}
-$VERSION = '6.10_02';
-($Revision = substr(q$Revision: 1.108 $, 10)) =~ s/\s+$//;
+$VERSION = '6.10_03';
+($Revision = substr(q$Revision: 1.109 $, 10)) =~ s/\s+$//;
require Exporter;
use Config;
@@ -203,6 +203,7 @@
EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
FULLPERL FULLPERLRUN FULLPERLRUNINST
FUNCLIST H IMPORTS
+
INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR
INSTALLDIRS
DESTDIR PREFIX
@@ -216,18 +217,18 @@
INSTALLSCRIPT
PERL_LIB PERL_ARCHLIB
SITELIBEXP SITEARCHEXP
+
INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS
- LINKTYPE MAKEAPERL MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
- MYEXTLIB
- PERL_MALLOC_OK
- NAME NEEDS_LINKING NOECHO NORECURS NO_VC OBJECT OPTIMIZE PERL PERLMAINCC
- PERLRUN PERLRUNINST PERL_CORE
+ LINKTYPE MAKEAPERL MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET MYEXTLIB
+ NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE
+ PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE
PERL_SRC PERM_RW PERM_RWX
PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC
PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
XS_VERSION clean depend dist dynamic_lib linkext macro realclean
tool_autosplit
+
MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC
MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED
/;
@@ -2016,7 +2017,7 @@
$VERSION = '1.00';
*VERSION = \'1.01';
- ( $VERSION ) = '$Revision: 1.108 $ ' =~ /\$Revision:\s+([^\s]+)/;
+ ( $VERSION ) = '$Revision: 1.109 $ ' =~ /\$Revision:\s+([^\s]+)/;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
==== //depot/maint-5.8/perl/lib/ExtUtils/TODO#3 (text) ====
Index: perl/lib/ExtUtils/TODO
--- perl/lib/ExtUtils/TODO#2~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/TODO Sat Apr 12 11:46:31 2003
@@ -53,3 +53,6 @@
Give typemap location its own macro.
Merge MM_VMS->tool_xsubpp
+
+Initialize PERL_SRC to '' instead of leaving undef when outside the source
+tree
==== //depot/maint-5.8/perl/lib/ExtUtils/t/00compile.t#3 (text) ====
Index: perl/lib/ExtUtils/t/00compile.t
--- perl/lib/ExtUtils/t/00compile.t#2~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/t/00compile.t Sat Apr 12 11:46:31 2003
@@ -30,7 +30,7 @@
chdir 'lib';
plan tests => scalar @modules * 2;
foreach my $file (@modules) {
- # 5.8.0 has a bug about require alone in an eval. Thus the extra
+ # 5.8.0 has a bug about require alone in an eval. Thus the extra
# statement.
eval q{ require($file); 1 };
is( $@, '', "require $file" );
@@ -39,5 +39,4 @@
skip "Test::Pod not installed", 1 unless $Has_Test_Pod;
pod_file_ok($file);
}
-
}
==== //depot/maint-5.8/perl/lib/ExtUtils/t/00setup_dummy.t#3 (text) ====
Index: perl/lib/ExtUtils/t/00setup_dummy.t
--- perl/lib/ExtUtils/t/00setup_dummy.t#2~19103~ Mon Mar 31 02:41:09 2003
+++ perl/lib/ExtUtils/t/00setup_dummy.t Sat Apr 12 11:46:31 2003
@@ -16,6 +16,23 @@
use File::Path;
use File::Spec;
+if( $^O eq 'VMS' ) {
+ # On older systems we might exceed the 8-level directory depth limit
+ # imposed by RMS. We get around this with a rooted logical, but we
+ # can't create logical names with attributes in Perl, so we do it
+ # in a DCL subprocess and put it in the job table so the parent sees it.
+ open( BFDTMP, '>bfdtesttmp.com' ) || die "Error creating command file; $!";
+ print BFDTMP <<'COMMAND';
+$ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
+$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
+COMMAND
+ close BFDTMP;
+
+ system '@bfdtesttmp.com';
+ 1 while unlink 'bfdtesttmp.com';
+}
+
+
my %Files = (
'Big-Dummy/lib/Big/Dummy.pm' => <<'END',
package Big::Dummy;
==== //depot/maint-5.8/perl/lib/ExtUtils/t/Constant.t#3 (text) ====
Index: perl/lib/ExtUtils/t/Constant.t
--- perl/lib/ExtUtils/t/Constant.t#2~18080~ Sun Nov 3 21:23:04 2002
+++ perl/lib/ExtUtils/t/Constant.t Sat Apr 12 11:46:31 2003
@@ -5,13 +5,17 @@
chdir 't' if -d 't';
@INC = '../lib';
}
+ use Config;
+ unless ($Config{usedl}) {
+ print "1..0 # no usedl, skipping\n";
+ exit 0;
+ }
}
# use warnings;
use strict;
use ExtUtils::MakeMaker;
use ExtUtils::Constant qw (constant_types C_constant XS_constant autoload);
-use Config;
use File::Spec;
use Cwd;
==== //depot/maint-5.8/perl/lib/ExtUtils/t/Installed.t#3 (text) ====
Index: perl/lib/ExtUtils/t/Installed.t
--- perl/lib/ExtUtils/t/Installed.t#2~18080~ Sun Nov 3 21:23:04 2002
+++ perl/lib/ExtUtils/t/Installed.t Sat Apr 12 11:46:31 2003
@@ -9,7 +9,9 @@
unshift @INC, 't/lib/';
}
}
-chdir 't';
+
+my $Is_VMS = $^O eq 'VMS';
+chdir($Is_VMS ? 'BFD_TEST_ROOT:[t]' : 't');
use strict;
@@ -54,7 +56,7 @@
# You can concatenate /foo but not foo:, which defaults in the current
# directory
-$prefix = VMS::Filespec::unixify($prefix) if $^O eq 'VMS';
+$prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
# ActivePerl 5.6.1/631 has $Config{prefixexp} as 'p:' for some reason
$prefix = $Config{prefix} if $prefix eq 'p:' && $^O eq 'MSWin32';
==== //depot/maint-5.8/perl/lib/ExtUtils/t/basic.t#4 (text) ====
Index: perl/lib/ExtUtils/t/basic.t
--- perl/lib/ExtUtils/t/basic.t#3~19165~ Tue Apr 8 10:43:04 2003
+++ perl/lib/ExtUtils/t/basic.t Sat Apr 12 11:46:31 2003
@@ -16,7 +16,7 @@
use strict;
use Config;
-use Test::More tests => 48;
+use Test::More tests => 52;
use MakeMaker::Test::Utils;
use File::Find;
use File::Spec;
@@ -28,33 +28,7 @@
my $perl = which_perl();
my $Is_VMS = $^O eq 'VMS';
-my $root_dir = 't';
-
-if( $^O eq 'VMS' ) {
- # On older systems we might exceed the 8-level directory depth limit
- # imposed by RMS. We get around this with a rooted logical, but we
- # can't create logical names with attributes in Perl, so we do it
- # in a DCL subprocess and put it in the job table so the parent sees it.
- open( BFDTMP, '>bfdtesttmp.com' ) || die "Error creating command file; $!";
- print BFDTMP <<'COMMAND';
-$ IF F$TRNLNM("PERL_CORE") .EQS. "" .AND. F$TYPE(PERL_CORE) .EQS. ""
-$ THEN
-$! building CPAN version
-$ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
-$ ELSE
-$! we're in the core
-$ BFD_TEST_ROOT =
F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
-$ ENDIF
-$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
-COMMAND
- close BFDTMP;
-
- system '@bfdtesttmp.com';
- END { 1 while unlink 'bfdtesttmp.com' }
- $root_dir = 'BFD_TEST_ROOT:[t]';
-}
-
-chdir $root_dir;
+chdir($Is_VMS ? 'BFD_TEST_ROOT:[t]' : 't');
perl_lib;
@@ -187,12 +161,20 @@
_normalize($manifest);
is( $manifest->{'meta.yml'}, 'Module meta-data in YAML' );
+# Test NO_META META.yml suppression
+unlink 'META.yml';
+ok( !-f 'META.yml', 'META.yml deleted' );
[EMAIL PROTECTED] = run(qq{$perl Makefile.PL "NO_META=1"});
+cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
+my $metafile_out = run("$make metafile");
+is( $?, 0, 'metafile' ) || diag($metafile_out);
+ok( !-f 'META.yml', 'META.yml generation suppressed by NO_META' );
+
# Make sure init_dirscan doesn't go into the distdir
@mpl_out = run(qq{$perl Makefile.PL "PREFIX=dummy-install"});
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
- diag(@mpl_out);
+cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1,
'init_dirscan skipped distdir') ||
==== //depot/maint-5.8/perl/lib/ExtUtils/t/zz_cleanup_dummy.t#2 (text) ====
Index: perl/lib/ExtUtils/t/zz_cleanup_dummy.t
--- perl/lib/ExtUtils/t/zz_cleanup_dummy.t#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/lib/ExtUtils/t/zz_cleanup_dummy.t Sat Apr 12 11:46:31 2003
@@ -8,7 +8,7 @@
unshift @INC, 't/lib';
}
}
-chdir 't';
+chdir($^O eq 'VMS' ? 'BFD_TEST_ROOT:[t]' : 't');
use strict;
==== //depot/maint-5.8/perl/lib/Getopt/Std.pm#2 (text) ====
Index: perl/lib/Getopt/Std.pm
--- perl/lib/Getopt/Std.pm#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/lib/Getopt/Std.pm Sat Apr 12 11:46:31 2003
@@ -46,11 +46,33 @@
both functions will stop processing switches when they see the argument
C<-->. The C<--> will be removed from @ARGV.
+=head1 C<--help> and C<--version>
+
+If C<-> is not a recognized switch letter, getopts() supports arguments
+C<--help> and C<--version>. If C<main::HELP_MESSAGE()> and/or
+C<main::VERSION_MESSAGE()> are defined, they are called; the arguments are
+the output file handle, the name of option-processing package, its version,
+and the switches string. If the subroutines are not defined, an attempt is
+made to generate intelligent messages; for best results, define $main::VERSION.
+
+Note that due to excessive paranoia, if $Getopt::Std::STANDARD_HELP_VERSION
+isn't true (the default is false), then the messages are printed on STDERR,
+and the processing continues after the messages are printed. This being
+the opposite of the standard-conforming behaviour, it is strongly recommended
+to set $Getopt::Std::STANDARD_HELP_VERSION to true.
+
+One can change the output file handle of the messages by setting
+$Getopt::Std::OUTPUT_HELP_VERSION. One can print the messages of C<--help>
+(without the C<Usage:> line) and C<--version> by calling functions help_mess()
+and version_mess() with the switches string as an argument.
+
=cut
@ISA = qw(Exporter);
@EXPORT = qw(getopt getopts);
-$VERSION = '1.03';
+$VERSION = '1.04';
+# uncomment the next line to disable 1.03-backward compatibility paranoia
+# $STANDARD_HELP_VERSION = 1;
# Process single-character switches with switch clustering. Pass one argument
# which is a string containing all switches that take an argument. For each
@@ -112,25 +134,86 @@
}
}
+sub output_h () {
+ return $OUTPUT_HELP_VERSION if defined $OUTPUT_HELP_VERSION;
+ return \*STDOUT if $STANDARD_HELP_VERSION;
+ return \*STDERR;
+}
+
+sub try_exit () {
+ exit 0 if $STANDARD_HELP_VERSION;
+ my $p = __PACKAGE__;
+ print {output_h()} <<EOM;
+ [Now continuing due to backward compatibility and excessive paranoia.
+ See ``perldoc $p'' about \$$p\::STANDARD_HELP_VERSION.]
+EOM
+}
+
+sub version_mess ($;$) {
+ my $args = shift;
+ my $h = output_h;
+ if (@_ and defined &main::VERSION_MESSAGE) {
+ main::VERSION_MESSAGE($h, __PACKAGE__, $VERSION, $args);
+ } else {
+ my $v = $main::VERSION;
+ $v = '[unknown]' unless defined $v;
+ my $myv = $VERSION;
+ $myv .= ' [paranoid]' unless $STANDARD_HELP_VERSION;
+ my $perlv = $];
+ $perlv = sprintf "%vd", $^V if $] >= 5.006;
+ print $h <<EOH;
+$0 version $v calling Getopt::Std::getopts (version $myv),
+running under Perl version $perlv.
+EOH
+ }
+}
+
+sub help_mess ($;$) {
+ my $args = shift;
+ my $h = output_h;
+ if (@_ and defined &main::HELP_MESSAGE) {
+ main::HELP_MESSAGE($h, __PACKAGE__, $VERSION, $args);
+ } else {
+ my (@witharg) = ($args =~ /(\S)\s*:/g);
+ my (@rest) = ($args =~ /([^\s:])(?!\s*:)/g);
+ my ($help, $arg) = ('', '');
+ if (@witharg) {
+ $help .= "\n\tWith arguments: -" . join " -", @witharg;
+ $arg = "\nSpace is not required between options and their arguments.";
+ }
+ if (@rest) {
+ $help .= "\n\tBoolean (without arguments): -" . join " -", @rest;
+ }
+ my ($scr) = ($0 =~ m,([^/\\]+)$,);
+ print $h <<EOH if @_; # Let the script override this
+Usage: $scr [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...]
+EOH
+ print $h <<EOH;
+The following single-character options are accepted:$help
+Options may be merged together. -- stops processing of options.$arg
+EOH
+ }
+}
+
# Usage:
# getopts('a:bc'); # -a takes arg. -b & -c not. Sets opt_* as a
# # side effect.
sub getopts ($;$) {
my ($argumentative, $hash) = @_;
- my (@args,$first,$rest);
+ my (@args,$first,$rest,$exit);
my $errs = 0;
local $_;
local @EXPORT;
@args = split( / */, $argumentative );
- while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
+ while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/s) {
($first,$rest) = ($1,$2);
if (/^--$/) { # early exit if --
shift @ARGV;
last;
}
- $pos = index($argumentative,$first);
+ my $pos = index($argumentative,$first);
if ($pos >= 0) {
if (defined($args[$pos+1]) and ($args[$pos+1] eq ':')) {
shift(@ARGV);
@@ -163,6 +246,18 @@
}
}
else {
+ if ($first eq '-' and $rest eq 'help') {
+ version_mess($argumentative, 'main');
+ help_mess($argumentative, 'main');
+ try_exit();
+ shift(@ARGV);
+ next;
+ } elsif ($first eq '-' and $rest eq 'version') {
+ version_mess($argumentative, 'main');
+ try_exit();
+ shift(@ARGV);
+ next;
+ }
warn "Unknown option: $first\n";
++$errs;
if ($rest ne '') {
==== //depot/maint-5.8/perl/lib/attributes.pm#2 (text) ====
Index: perl/lib/attributes.pm
--- perl/lib/attributes.pm#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/lib/attributes.pm Sat Apr 12 11:46:31 2003
@@ -261,7 +261,7 @@
This method is called with two fixed arguments, followed by the list of
attributes from the relevant declaration. The two fixed arguments are
the relevant package name and a reference to the declared subroutine or
-variable. The expected return value as a list of attributes which were
+variable. The expected return value is a list of attributes which were
not recognized by this handler. Note that this allows for a derived class
to delegate a call to its base class, and then only examine the attributes
which the base class didn't already handle for it.
==== //depot/maint-5.8/perl/lib/base.pm#2 (text) ====
Index: perl/lib/base.pm
--- perl/lib/base.pm#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/lib/base.pm Sat Apr 12 11:46:31 2003
@@ -22,15 +22,15 @@
pragma will croak if multiple base classes have a %FIELDS hash. See
L<fields> for a description of this feature.
-When strict 'vars' is in scope I<base> also let you assign to @ISA
+When strict 'vars' is in scope, I<base> also lets you assign to @ISA
without having to declare @ISA with the 'vars' pragma first.
If any of the base classes are not loaded yet, I<base> silently
-C<require>s them. Whether to C<require> a base class package is
-determined by the absence of a global $VERSION in the base package.
-If $VERSION is not detected even after loading it, <base> will
-define $VERSION in the base package, setting it to the string
-C<-1, set by base.pm>.
+C<require>s them (but it won't call the C<import> method). Whether to
+C<require> a base class package is determined by the absence of a global
+$VERSION in the base package. If $VERSION is not detected even after
+loading it, I<base> will define $VERSION in the base package, setting it to
+the string C<-1, set by base.pm>.
=head1 HISTORY
==== //depot/maint-5.8/perl/lib/locale.t#2 (text) ====
Index: perl/lib/locale.t
--- perl/lib/locale.t#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/lib/locale.t Sat Apr 12 11:46:31 2003
@@ -523,7 +523,17 @@
my $word = join('', @Neoalpha);
- if ($Locale =~ /utf-?8/i) {
+ my $badutf8;
+ {
+ local $SIG{__WARN__} = sub {
+ $badutf8 = $_[0] =~ /Malformed UTF-8/;
+ };
+ $Locale =~ /utf-?8/i;
+ }
+
+ if ($badutf8) {
+ debug "# Locale name contains bad UTF-8, skipping test 99 for locale
'$Locale'\n";
+ } elsif ($Locale =~ /utf-?8/i) {
debug "# unknown whether locale and Unicode have the same \\w, skipping
test 99 for locale '$Locale'\n";
push @{$Okay{99}}, $Locale;
} else {
==== //depot/maint-5.8/perl/numeric.c#5 (text) ====
Index: perl/numeric.c
--- perl/numeric.c#4~18808~ Sun Mar 2 13:29:38 2003
+++ perl/numeric.c Sat Apr 12 11:46:31 2003
@@ -197,7 +197,7 @@
++s;
goto redo;
}
- if (ckWARN(WARN_DIGIT))
+ if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT) && ckWARN(WARN_DIGIT))
Perl_warner(aTHX_ packWARN(WARN_DIGIT),
"Illegal binary digit '%c' ignored", *s);
break;
@@ -312,7 +312,7 @@
++s;
goto redo;
}
- if (ckWARN(WARN_DIGIT))
+ if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT) && ckWARN(WARN_DIGIT))
Perl_warner(aTHX_ packWARN(WARN_DIGIT),
"Illegal hexadecimal digit '%c' ignored", *s);
break;
@@ -398,7 +398,7 @@
* as soon as non-octal characters are seen, complain only iff
* someone seems to want to use the digits eight and nine). */
if (digit == 8 || digit == 9) {
- if (ckWARN(WARN_DIGIT))
+ if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT) && ckWARN(WARN_DIGIT))
Perl_warner(aTHX_ packWARN(WARN_DIGIT),
"Illegal octal digit '%c' ignored", *s);
}
==== //depot/maint-5.8/perl/op.c#20 (text) ====
Index: perl/op.c
--- perl/op.c#19~19161~ Sun Apr 6 21:20:20 2003
+++ perl/op.c Sat Apr 12 11:46:31 2003
@@ -5267,9 +5267,51 @@
else if (kid->op_type == OP_AELEM
|| kid->op_type == OP_HELEM)
{
- name = "__ANONIO__";
- len = 10;
- mod(kid,type);
+ OP *op;
+
+ name = 0;
+ if ((op = ((BINOP*)kid)->op_first)) {
+ SV *tmpstr = Nullsv;
+ char *a =
+ kid->op_type == OP_AELEM ?
+ "[]" : "{}";
+ if (((op->op_type == OP_RV2AV) ||
+ (op->op_type == OP_RV2HV)) &&
+ (op = ((UNOP*)op)->op_first) &&
+ (op->op_type == OP_GV)) {
+ /* packagevar $a[] or $h{} */
+ GV *gv = cGVOPx_gv(op);
+ if (gv)
+ tmpstr =
+ Perl_newSVpvf(aTHX_
+ "%s%c...%c",
+ GvNAME(gv),
+ a[0], a[1]);
+ }
+ else if (op->op_type == OP_PADAV
+ || op->op_type == OP_PADHV) {
+ /* lexicalvar $a[] or $h{} */
+ char *padname =
+ PAD_COMPNAME_PV(op->op_targ);
+ if (padname)
+ tmpstr =
+ Perl_newSVpvf(aTHX_
+ "%s%c...%c",
+ padname + 1,
+ a[0], a[1]);
+
+ }
+ if (tmpstr) {
+ name = savepv(SvPVX(tmpstr));
+ len = strlen(name);
+ sv_2mortal(tmpstr);
+ }
+ }
+ if (!name) {
+ name = "__ANONIO__";
+ len = 10;
+ }
+ mod(kid, type);
}
if (name) {
SV *namesv;
@@ -5616,6 +5658,25 @@
}
if (o->op_type == OP_BACKTICK)
return o;
+ {
+ /* In case of three-arg dup open remove strictness
+ * from the last arg if it is a bareword. */
+ OP *first = cLISTOPx(o)->op_first; /* The pushmark. */
+ OP *last = cLISTOPx(o)->op_last; /* The bareword. */
+ OP *oa;
+ char *mode;
+
+ if ((last->op_type == OP_CONST) && /* The bareword. */
+ (last->op_private & OPpCONST_BARE) &&
+ (last->op_private & OPpCONST_STRICT) &&
+ (oa = first->op_sibling) && /* The fh. */
+ (oa = oa->op_sibling) && /* The mode. */
+ SvPOK(((SVOP*)oa)->op_sv) &&
+ (mode = SvPVX(((SVOP*)oa)->op_sv)) &&
+ mode[0] == '>' && mode[1] == '&' && /* A dup open. */
+ (last == oa->op_sibling)) /* The bareword. */
+ last->op_private &= ~OPpCONST_STRICT;
+ }
return ck_fun(o);
}
==== //depot/maint-5.8/perl/perl.c#28 (text) ====
Index: perl/perl.c
--- perl/perl.c#27~19161~ Sun Apr 6 21:20:20 2003
+++ perl/perl.c Sat Apr 12 11:46:31 2003
@@ -2300,19 +2300,42 @@
switch (*s) {
case '0':
{
- I32 flags = 0;
- numlen = 4;
- rschar = (U32)grok_oct(s, &numlen, &flags, NULL);
- SvREFCNT_dec(PL_rs);
- if (rschar & ~((U8)~0))
- PL_rs = &PL_sv_undef;
- else if (!rschar && numlen >= 2)
- PL_rs = newSVpvn("", 0);
- else {
- char ch = (char)rschar;
- PL_rs = newSVpvn(&ch, 1);
- }
- return s + numlen;
+ I32 flags = 0;
+
+ SvREFCNT_dec(PL_rs);
+ if (s[1] == 'x' && s[2]) {
+ char *e;
+ U8 *tmps;
+
+ for (s += 2, e = s; *e; e++);
+ numlen = e - s;
+ flags = PERL_SCAN_SILENT_ILLDIGIT;
+ rschar = (U32)grok_hex(s, &numlen, &flags, NULL);
+ if (s + numlen < e) {
+ rschar = 0; /* Grandfather -0xFOO as -0 -xFOO. */
+ numlen = 0;
+ s--;
+ }
+ PL_rs = newSVpvn("", 0);
+ SvGROW(PL_rs, UNISKIP(rschar) + 1);
+ tmps = (U8*)SvPVX(PL_rs);
+ uvchr_to_utf8(tmps, rschar);
+ SvCUR_set(PL_rs, UNISKIP(rschar));
+ SvUTF8_on(PL_rs);
+ }
+ else {
+ numlen = 4;
+ rschar = (U32)grok_oct(s, &numlen, &flags, NULL);
+ if (rschar & ~((U8)~0))
+ PL_rs = &PL_sv_undef;
+ else if (!rschar && numlen >= 2)
+ PL_rs = newSVpvn("", 0);
+ else {
+ char ch = (char)rschar;
+ PL_rs = newSVpvn(&ch, 1);
+ }
+ }
+ return s + numlen;
}
case 'C':
s++;
==== //depot/maint-5.8/perl/perl.h#24 (text) ====
Index: perl/perl.h
--- perl/perl.h#23~19011~ Mon Mar 17 11:15:23 2003
+++ perl/perl.h Sat Apr 12 11:46:31 2003
@@ -4233,6 +4233,7 @@
/* Input flags: */
#define PERL_SCAN_ALLOW_UNDERSCORES 0x01 /* grok_??? accept _ in numbers */
#define PERL_SCAN_DISALLOW_PREFIX 0x02 /* grok_??? reject 0x in hex etc */
+#define PERL_SCAN_SILENT_ILLDIGIT 0x04 /* grok_??? not warn about illegal digits
*/
/* Output flags: */
#define PERL_SCAN_GREATER_THAN_UV_MAX 0x02 /* should this merge with above? */
==== //depot/maint-5.8/perl/pod/perlfaq.pod#5 (text) ====
Index: perl/pod/perlfaq.pod
--- perl/pod/perlfaq.pod#4~18617~ Sat Feb 1 12:05:08 2003
+++ perl/pod/perlfaq.pod Sat Apr 12 11:46:31 2003
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq - frequently asked questions about Perl ($Date: 2003/01/26 17:45:46 $)
+perlfaq - frequently asked questions about Perl ($Date: 2003/01/31 17:37:17 $)
=head1 DESCRIPTION
@@ -70,9 +70,33 @@
=head1 Table of Contents
-=head2 perlfaq: Structural overview of the FAQ.
+=over 4
+
+=item perlfaq - this document
+
+=item perlfaq1 - General Questions About Perl
+
+=item perlfaq2 - Obtaining and Learning about Perl
+
+=item perlfaq3 - Programming Tools
+
+=item perlfaq4 - Data Manipulation
+
+=item perlfaq5 - Files and Formats
+
+=item perlfaq6 - Regular Expressions
+
+=item perlfaq7 - General Perl Language Issues
-This document.
+=item perlfaq8 - System Interaction
+
+=item perlfaq9 - Networking
+
+
+=back
+
+
+=head1 The Questions
=head2 L<perlfaq1>: General Questions About Perl
@@ -412,7 +436,7 @@
=item *
-How do I find the week-of-the-year/day-of-the-year?
+How do I find the day or week of the year?
=item *
@@ -1049,6 +1073,10 @@
=item *
How can I use a variable as a variable name?
+
+=item *
+
+What does "bad interpreter" mean?
=back
==== //depot/maint-5.8/perl/pod/perlfaq3.pod#5 (text) ====
Index: perl/pod/perlfaq3.pod
--- perl/pod/perlfaq3.pod#4~18617~ Sat Feb 1 12:05:08 2003
+++ perl/pod/perlfaq3.pod Sat Apr 12 11:46:31 2003
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq3 - Programming Tools ($Revision: 1.32 $, $Date: 2003/01/26 17:41:53 $)
+perlfaq3 - Programming Tools ($Revision: 1.33 $, $Date: 2003/01/31 17:34:56 $)
=head1 DESCRIPTION
@@ -466,45 +466,33 @@
The best way to do this is to come up with a better algorithm. This
can often make a dramatic difference. Jon Bentley's book
-``Programming Pearls'' (that's not a misspelling!) has some good tips
+I<Programming Pearls> (that's not a misspelling!) has some good tips
on optimization, too. Advice on benchmarking boils down to: benchmark
and profile to make sure you're optimizing the right part, look for
better algorithms instead of microtuning your code, and when all else
fails consider just buying faster hardware. You will probably want to
-read the answer to the earlier question ``How do I profile my Perl programs?''
-if you haven't done so already.
+read the answer to the earlier question ``How do I profile my Perl
+programs?'' if you haven't done so already.
A different approach is to autoload seldom-used Perl code. See the
AutoSplit and AutoLoader modules in the standard distribution for
that. Or you could locate the bottleneck and think about writing just
that part in C, the way we used to take bottlenecks in C code and
-write them in assembler. Similar to rewriting in C,
-modules that have critical sections can be written in C (for instance, the
-PDL module from CPAN).
-
-In some cases, it may be worth it to use the backend compiler to
-produce byte code (saving compilation time) or compile into C, which
-will certainly save compilation time and sometimes a small amount (but
-not much) execution time. See the question about compiling your Perl
-programs for more on the compiler--the wins aren't as obvious as you'd
-hope.
-
-If you're currently linking your perl executable to a shared I<libc.so>,
-you can often gain a 10-25% performance benefit by rebuilding it to
-link with a static libc.a instead. This will make a bigger perl
-executable, but your Perl programs (and programmers) may thank you for
-it. See the F<INSTALL> file in the source distribution for more
-information.
-
-Unsubstantiated reports allege that Perl interpreters that use sfio
-outperform those that don't (for I/O intensive applications). To try
-this, see the F<INSTALL> file in the source distribution, especially
-the ``Selecting File I/O mechanisms'' section.
-
-The undump program was an old attempt to speed up your Perl program
-by storing the already-compiled form to disk. This is no longer
-a viable option, as it only worked on a few architectures, and
-wasn't a good solution anyway.
+write them in assembler. Similar to rewriting in C, modules that have
+critical sections can be written in C (for instance, the PDL module
+from CPAN).
+
+If you're currently linking your perl executable to a shared
+I<libc.so>, you can often gain a 10-25% performance benefit by
+rebuilding it to link with a static libc.a instead. This will make a
+bigger perl executable, but your Perl programs (and programmers) may
+thank you for it. See the F<INSTALL> file in the source distribution
+for more information.
+
+The undump program was an ancient attempt to speed up Perl program by
+storing the already-compiled form to disk. This is no longer a viable
+option, as it only worked on a few architectures, and wasn't a good
+solution anyway.
=head2 How can I make my Perl program take less memory?
==== //depot/maint-5.8/perl/pod/perlfaq4.pod#6 (text) ====
Index: perl/pod/perlfaq4.pod
--- perl/pod/perlfaq4.pod#5~18617~ Sat Feb 1 12:05:08 2003
+++ perl/pod/perlfaq4.pod Sat Apr 12 11:46:31 2003
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq4 - Data Manipulation ($Revision: 1.40 $, $Date: 2003/01/26 17:43:21 $)
+perlfaq4 - Data Manipulation ($Revision: 1.43 $, $Date: 2003/02/23 20:25:09 $)
=head1 DESCRIPTION
@@ -316,7 +316,7 @@
If you're using a version of Perl before 5.004, you must call C<srand>
once at the start of your program to seed the random number generator.
- BEGIN { srand() if $[ < 5.004 }
+ BEGIN { srand() if $] < 5.004 }
5.004 and later automatically call C<srand> at the beginning. Don't
call C<srand> more than once---you make your numbers less random, rather
@@ -353,13 +353,34 @@
=head1 Data: Dates
-=head2 How do I find the week-of-the-year/day-of-the-year?
+=head2 How do I find the day or week of the year?
-The day of the year is in the array returned by localtime() (see
-L<perlfunc/"localtime">):
-
- $day_of_year = (localtime(time()))[7];
+The localtime function returns the day of the week. Without an
+argument localtime uses the current time.
+ $day_of_year = (localtime)[7];
+
+The POSIX module can also format a date as the day of the year or
+week of the year.
+
+ use POSIX qw/strftime/;
+ my $day_of_year = strftime "%j", localtime;
+ my $week_of_year = strftime "%W", localtime;
+
+To get the day of year for any date, use the Time::Local module to get
+a time in epoch seconds for the argument to localtime.
+
+ use POSIX qw/strftime/;
+ use Time::Local;
+ my $week_of_year = strftime "%W",
+ localtime( timelocal( 0, 0, 0, 18, 11, 1987 ) );
+
+The Date::Calc module provides two functions for to calculate these.
+
+ use Date::Calc;
+ my $day_of_year = Day_of_Year( 1987, 12, 18 );
+ my $week_of_year = Week_of_Year( 1987, 12, 18 );
+
=head2 How do I find the current century or millennium?
Use the following simple functions:
==== //depot/maint-5.8/perl/pod/perlfaq7.pod#5 (text) ====
Index: perl/pod/perlfaq7.pod
--- perl/pod/perlfaq7.pod#4~18617~ Sat Feb 1 12:05:08 2003
+++ perl/pod/perlfaq7.pod Sat Apr 12 11:46:31 2003
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq7 - General Perl Language Issues ($Revision: 1.13 $, $Date: 2003/01/26
17:45:46 $)
+perlfaq7 - General Perl Language Issues ($Revision: 1.14 $, $Date: 2003/01/31
17:38:14 $)
=head1 DESCRIPTION
@@ -878,6 +878,31 @@
subroutines, because they are always global--you can't use my() on them.
For scalars, arrays, and hashes, though--and usually for subroutines--
you probably only want to use hard references.
+
+=head2 What does "bad interpreter" mean?
+
+The "bad interpreter" message comes from the shell, not perl. The
+actual message may vary depending on your platform, shell, and locale
+settings.
+
+If you see "bad interpreter - no such file or directory", the first
+line in your perl script (the "shebang" line) does not contain the
+right path to perl (or any other program capable of running scripts).
+Sometimes this happens when you move the script from one machine to
+another and each machine has a different path to perl---/usr/bin/perl
+versus /usr/local/bin/perl for instance.
+
+If you see "bad interpreter: Permission denied", you need to make your
+script executable.
+
+In either case, you should still be able to run the scripts with perl
+explicitly:
+
+ % perl script.pl
+
+If you get a message like "perl: command not found", perl is not in
+your PATH, which might also mean that the location of perl is not
+where you expect it so you need to adjust your shebang line.
=head1 AUTHOR AND COPYRIGHT
==== //depot/maint-5.8/perl/pod/perlfaq9.pod#4 (text) ====
Index: perl/pod/perlfaq9.pod
--- perl/pod/perlfaq9.pod#3~18466~ Thu Jan 9 06:07:25 2003
+++ perl/pod/perlfaq9.pod Sat Apr 12 11:46:31 2003
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq9 - Networking ($Revision: 1.14 $, $Date: 2002/12/06 07:40:11 $)
+perlfaq9 - Networking ($Revision: 1.15 $, $Date: 2003/01/31 17:36:57 $)
=head1 DESCRIPTION
@@ -557,17 +557,17 @@
=head2 How do I read mail?
While you could use the Mail::Folder module from CPAN (part of the
-MailFolder package) or the Mail::Internet module from CPAN (also part
+MailFolder package) or the Mail::Internet module from CPAN (part
of the MailTools package), often a module is overkill. Here's a
mail sorter.
#!/usr/bin/perl
- # bysub1 - simple sort by subject
+
my(@msgs, @sub);
my $msgno = -1;
$/ = ''; # paragraph reads
while (<>) {
- if (/^From/m) {
+ if (/^From /m) {
/^Subject:\s*(?:Re:\s*)*(.*)/mi;
$sub[++$msgno] = lc($1) || '';
}
==== //depot/maint-5.8/perl/pod/perlpod.pod#2 (text) ====
Index: perl/pod/perlpod.pod
--- perl/pod/perlpod.pod#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/pod/perlpod.pod Sat Apr 12 11:46:31 2003
@@ -552,7 +552,7 @@
which is presumably easier to read than the old way:
C<open(X, "E<gt>E<gt>thing.dat") || die $!>
- C<$foo-E<gt>bar(); >>
+ C<$foo-E<gt>bar();>
This is currently supported by pod2text (Pod::Text), pod2man (Pod::Man),
and any other pod2xxx or Pod::Xxxx translators that use
==== //depot/maint-5.8/perl/pod/perlport.pod#6 (text) ====
Index: perl/pod/perlport.pod
--- perl/pod/perlport.pod#5~19093~ Sun Mar 30 07:16:16 2003
+++ perl/pod/perlport.pod Sat Apr 12 11:46:31 2003
@@ -629,6 +629,22 @@
If you really want to be international, you should consider Unicode.
See L<perluniintro> and L<perlunicode> for more information.
+If you want to use non-ASCII bytes (outside the bytes 0x00..0x7f) in
+the "source code" of your code, to be portable you have to be explicit
+about what bytes they are. Someone might for example be using your
+code under a UTF-8 locale, in which case random native bytes might be
+illegal ("Malformed UTF-8 ...") This means that for example embedding
+ISO 8859-1 bytes beyond 0x7f into your strings might cause trouble
+later. If the bytes are native 8-bit bytes, you can use the C<bytes>
+pragma. If the bytes are in a string (regular expression being a
+curious string), you can often also use the C<\xHH> notation instead
+of embedding the bytes as-is. If they are in some particular legacy
+encoding (ether single-byte or something more complicated), you can
+use the C<encoding> pragma. (If you want to write your code in UTF-8,
+you can use either the C<utf8> pragma, or the C<encoding> pragma.)
+The C<bytes> and C<utf8> pragmata are available since Perl 5.6.0, and
+the C<encoding> pragma since Perl 5.8.0.
+
=head2 System Resources
If your code is destined for systems with severely constrained (or
==== //depot/maint-5.8/perl/pod/perlrun.pod#16 (text) ====
Index: perl/pod/perlrun.pod
--- perl/pod/perlrun.pod#15~19165~ Tue Apr 8 10:43:04 2003
+++ perl/pod/perlrun.pod Sat Apr 12 11:46:31 2003
@@ -7,7 +7,7 @@
B<perl> S<[ B<-sTtuUWX> ]>
S<[ B<-hv> ] [ B<-V>[:I<configvar>] ]>
S<[ B<-cw> ] [ B<-d>[:I<debugger>] ] [ B<-D>[I<number/list>] ]>
- S<[ B<-pna> ] [ B<-F>I<pattern> ] [ B<-l>[I<octal>] ] [ B<-0>[I<octal>] ]>
+ S<[ B<-pna> ] [ B<-F>I<pattern> ] [ B<-l>[I<octal>] ] [
B<-0>[I<octal/hexadecimal>] ]>
S<[ B<-I>I<dir> ] [ B<-m>[B<->]I<module> ] [ B<-M>[B<->]I<'module...'> ]>
S<[ B<-P> ]>
S<[ B<-S> ]>
@@ -234,19 +234,24 @@
=over 5
-=item B<-0>[I<digits>]
+=item B<-0>[I<octal/hexadecimal>]
-specifies the input record separator (C<$/>) as an octal number. If there are
-no digits, the null character is the separator. Other switches may
-precede or follow the digits. For example, if you have a version of
-B<find> which can print filenames terminated by the null character, you
-can say this:
+specifies the input record separator (C<$/>) as an octal or
+hexadecimal number. If there are no digits, the null character is the
+separator. Other switches may precede or follow the digits. For
+example, if you have a version of B<find> which can print filenames
+terminated by the null character, you can say this:
find . -name '*.orig' -print0 | perl -n0e unlink
The special value 00 will cause Perl to slurp files in paragraph mode.
The value 0777 will cause Perl to slurp files whole because there is no
-legal character with that value.
+legal byte with that value.
+
+If you want to specify any Unicode character, use the hexadecimal
+format: C<-0xHHH...>, where the C<H> are valid hexadecimal digits.
+(This means that you cannot use the C<-x> with a directory name that
+consists of hexadecimal digits.)
=item B<-a>
@@ -961,7 +966,7 @@
Applying the <:raw> layer is equivalent to calling C<binmode($fh)>.
It makes the stream pass each byte as-is without any translation.
-In particular CRLF translation, and/or :utf8 inuited from locale
+In particular CRLF translation, and/or :utf8 intuited from locale
are disabled.
Arranges for all accesses go straight to the lowest buffered layer provided
==== //depot/maint-5.8/perl/sv.h#14 (text) ====
Index: perl/sv.h
--- perl/sv.h#13~19093~ Sun Mar 30 07:16:16 2003
+++ perl/sv.h Sat Apr 12 11:46:31 2003
@@ -327,7 +327,7 @@
U8 xbm_rare; /* rarest character in string */
};
-/* This structure much match XPVCV in cv.h */
+/* This structure must match XPVCV in cv.h */
typedef U16 cv_flags_t;
==== //depot/maint-5.8/perl/t/io/open.t#3 (xtext) ====
Index: perl/t/io/open.t
--- perl/t/io/open.t#2~18080~ Sun Nov 3 21:23:04 2002
+++ perl/t/io/open.t Sat Apr 12 11:46:31 2003
@@ -12,7 +12,7 @@
$Is_VMS = $^O eq 'VMS';
$Is_MacOS = $^O eq 'MacOS';
-plan tests => 95;
+plan tests => 100;
my $Perl = which_perl();
@@ -228,6 +228,11 @@
ok( open(my $stdout, ">&", \*STDOUT), 'dup \*STDOUT into lexical fh');
ok( open(STDOUT, ">&", $stdout), 'restore dupped STDOUT from lexical
fh');
+ {
+ use strict; # the below should not warn
+ ok( open(my $stdout, ">&", STDOUT), 'dup STDOUT into lexical fh');
+ }
+
# used to try to open a file [perl #17830]
ok( open(my $stdin, "<&", fileno STDIN), 'dup fileno(STDIN) into lexical fh');
}
@@ -244,3 +249,34 @@
ok( !eval { open F, "BAR", "QUUX" }, 'Unknown open() mode' );
like( $@, qr/\QUnknown open() mode 'BAR'/, ' right error' );
}
+
+{
+ local $SIG{__WARN__} = sub { $@ = shift };
+
+ sub gimme {
+ my $tmphandle = shift;
+ my $line = scalar <$tmphandle>;
+ warn "gimme";
+ return $line;
+ }
+
+ open($fh0[0], "TEST");
+ gimme($fh0[0]);
+ like($@, qr/<\$fh0\[...\]> line 1\./, "autoviv fh package aelem");
+
+ open($fh1{k}, "TEST");
+ gimme($fh1{k});
+ like($@, qr/<\$fh1{...}> line 1\./, "autoviv fh package helem");
+
+ my @fh2;
+ open($fh2[0], "TEST");
+ gimme($fh2[0]);
+ like($@, qr/<\$fh2\[...\]> line 1\./, "autoviv fh lexical aelem");
+
+ my %fh3;
+ open($fh3{k}, "TEST");
+ gimme($fh3{k});
+ like($@, qr/<\$fh3{...}> line 1\./, "autoviv fh lexical helem");
+
+}
+
==== //depot/maint-5.8/perl/vms/perlvms.pod#3 (text) ====
Index: perl/vms/perlvms.pod
--- perl/vms/perlvms.pod#2~18928~ Tue Mar 11 12:09:47 2003
+++ perl/vms/perlvms.pod Sat Apr 12 11:46:31 2003
@@ -308,11 +308,15 @@
=item *
-C<2E<gt>file> writes stderr to C<file>, and
+C<2E<gt>file> writes stderr to C<file>,
=item *
-C<2E<gt>E<gt>file> appends stderr to C<file>.
+C<2E<gt>E<gt>file> appends stderr to C<file>, and
+
+=item *
+
+C<< 2>&1 >> redirects stderr to stdout.
=back
End of Patch.