summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-02-12 08:52:14 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-02-12 08:52:14 +0000
commita48abc44380b16821695ec705c8c8f3bfb09db6c (patch)
tree8b1b66a7ac8bccd992d7de4e3d7f7089cdc024ce
parent2ee0eb3cdf0bc0b8d47fbc6651740891de63e1b5 (diff)
parent9c79236d7175b8f41c4e17950788a40bc979aebb (diff)
downloadperl-a48abc44380b16821695ec705c8c8f3bfb09db6c.tar.gz
Integrate from mainperl.
p4raw-id: //depot/cfgperl@2886
-rw-r--r--MAINTAIN2
-rw-r--r--MANIFEST1
-rw-r--r--embed.h1
-rwxr-xr-xembed.pl1
-rw-r--r--ext/IO/ChangeLog2
-rw-r--r--ext/IO/README9
-rw-r--r--ext/IO/lib/IO/Dir.pm3
-rw-r--r--ext/IO/lib/IO/Pipe.pm9
-rw-r--r--ext/IO/lib/IO/Poll.pm3
-rw-r--r--ext/IO/lib/IO/Select.pm3
-rw-r--r--ext/IO/lib/IO/Socket.pm26
-rw-r--r--ext/IO/lib/IO/Socket/INET.pm3
-rw-r--r--ext/IO/lib/IO/Socket/UNIX.pm3
-rw-r--r--lib/ExtUtils/MakeMaker.pm11
-rw-r--r--lib/Pod/Text.pm4
-rw-r--r--objXSUB.h2
-rw-r--r--op.c37
-rw-r--r--perl.c30
-rw-r--r--pod/perldiag.pod5
-rw-r--r--pod/perlguts.pod6
-rw-r--r--pod/perlre.pod6
-rw-r--r--pod/perlrun.pod3
-rw-r--r--pp.c30
-rw-r--r--pp_hot.c36
-rw-r--r--pp_sys.c9
-rw-r--r--proto.h1
-rwxr-xr-xt/op/fh.t24
-rwxr-xr-xt/op/gv.t27
-rwxr-xr-xt/op/misc.t8
-rw-r--r--utils/perldoc.PL4
-rw-r--r--win32/pod.mak11
31 files changed, 248 insertions, 72 deletions
diff --git a/MAINTAIN b/MAINTAIN
index 0daec7ffe4..deb4b39a1c 100644
--- a/MAINTAIN
+++ b/MAINTAIN
@@ -168,7 +168,7 @@ ext/GDBM_File/GDBM_File.pm
ext/GDBM_File/GDBM_File.xs
ext/GDBM_File/Makefile.PL
ext/GDBM_File/typemap
-ext/IO/* gbarr
+ext/IO/*
ext/IPC/SysV/* gbarr
ext/NDBM_File/Makefile.PL
ext/NDBM_File/NDBM_File.pm
diff --git a/MANIFEST b/MANIFEST
index d95ed45d4f..344c581702 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1140,6 +1140,7 @@ t/op/each.t See if hash iterators work
t/op/eval.t See if eval operator works
t/op/exec.t See if exec and system work
t/op/exp.t See if math functions work
+t/op/fh.t See if filehandles work
t/op/filetest.t See if file tests work
t/op/flip.t See if range operator works
t/op/fork.t See if fork works
diff --git a/embed.h b/embed.h
index 6fc73ca1b8..68a90a49b1 100644
--- a/embed.h
+++ b/embed.h
@@ -1288,6 +1288,7 @@
#define invert CPerlObj::Perl_invert
#define io_close CPerlObj::Perl_io_close
#define is_an_int CPerlObj::Perl_is_an_int
+#define is_handle_constructor CPerlObj::Perl_is_handle_constructor
#define is_uni_alnum CPerlObj::Perl_is_uni_alnum
#define is_uni_alnum_lc CPerlObj::Perl_is_uni_alnum_lc
#define is_uni_alpha CPerlObj::Perl_is_uni_alpha
diff --git a/embed.pl b/embed.pl
index 3aabd9f609..7d3039ecf7 100755
--- a/embed.pl
+++ b/embed.pl
@@ -376,6 +376,7 @@ my @staticfuncs = qw(
bset_obj_store
new_logop
simplify_sort
+ is_handle_constructor
do_trans_CC_simple
do_trans_CC_count
do_trans_CC_complex
diff --git a/ext/IO/ChangeLog b/ext/IO/ChangeLog
index 28bc4319b8..c45e785326 100644
--- a/ext/IO/ChangeLog
+++ b/ext/IO/ChangeLog
@@ -1,3 +1,5 @@
+For more recent changes, see the Perl Changes* file(s).
+
Change 173 on 1998/07/14 by <gbarr@pobox.com> (Graham Barr)
IO::Socket
diff --git a/ext/IO/README b/ext/IO/README
index 375e2acdf6..191d5504bc 100644
--- a/ext/IO/README
+++ b/ext/IO/README
@@ -1,4 +1,5 @@
-This directory contains files from the IO distribution maintained by
-Graham Barr <gbarr@pobox.com>. If you find that you have to modify
-any files in this directory then please forward him a patch for only
-the files in this directory.
+This directory contains files from the IO distribution created by
+Graham Barr. It is currently maintained by the Perl Porters as part
+of the Perl source distribution. If you find that you have to modify
+any files in this directory then please forward them a patch at
+<perl5-porters@perl.org>.
diff --git a/ext/IO/lib/IO/Dir.pm b/ext/IO/lib/IO/Dir.pm
index cb612d5fc4..f505e794b8 100644
--- a/ext/IO/lib/IO/Dir.pm
+++ b/ext/IO/lib/IO/Dir.pm
@@ -227,7 +227,8 @@ L<File::stat>
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>
+Graham Barr. Currently maintained by the Perl Porters. Please report all
+bugs to <perl5-porters@perl.org>.
=head1 COPYRIGHT
diff --git a/ext/IO/lib/IO/Pipe.pm b/ext/IO/lib/IO/Pipe.pm
index 3a91b9e90d..daf6fe699b 100644
--- a/ext/IO/lib/IO/Pipe.pm
+++ b/ext/IO/lib/IO/Pipe.pm
@@ -14,7 +14,7 @@ use vars qw($VERSION);
use Carp;
use Symbol;
-$VERSION = "1.12";
+$VERSION = "1.121";
sub new {
my $type = shift;
@@ -100,7 +100,7 @@ sub reader {
close ${*$me}[1];
bless $me, ref($fh);
- *{*$me} = *{*$fh}; # Alias self to handle
+ *$me = *$fh; # Alias self to handle
$me->fdopen($fh->fileno,"r")
unless defined($me->fileno);
bless $fh; # Really wan't un-bless here
@@ -123,7 +123,7 @@ sub writer {
close ${*$me}[0];
bless $me, ref($fh);
- *{*$me} = *{*$fh}; # Alias self to handle
+ *$me = *$fh; # Alias self to handle
$me->fdopen($fh->fileno,"w")
unless defined($me->fileno);
bless $fh; # Really wan't un-bless here
@@ -240,7 +240,8 @@ L<IO::Handle>
=head1 AUTHOR
-Graham Barr <gbarr@pobox.com>
+Graham Barr. Currently maintained by the Perl Porters. Please report all
+bugs to <perl5-porters@perl.org>.
=head1 COPYRIGHT
diff --git a/ext/IO/lib/IO/Poll.pm b/ext/IO/lib/IO/Poll.pm
index 3a31eb9d56..a984985d39 100644
--- a/ext/IO/lib/IO/Poll.pm
+++ b/ext/IO/lib/IO/Poll.pm
@@ -193,7 +193,8 @@ L<poll(2)>, L<IO::Handle>, L<IO::Select>
=head1 AUTHOR
-Graham Barr <gbarr@pobox.com>
+Graham Barr. Currently maintained by the Perl Porters. Please report all
+bugs to <perl5-porters@perl.org>.
=head1 COPYRIGHT
diff --git a/ext/IO/lib/IO/Select.pm b/ext/IO/lib/IO/Select.pm
index ccb49b8c30..f021a797ec 100644
--- a/ext/IO/lib/IO/Select.pm
+++ b/ext/IO/lib/IO/Select.pm
@@ -365,7 +365,8 @@ listening for more connections on a listen socket
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>
+Graham Barr. Currently maintained by the Perl Porters. Please report all
+bugs to <perl5-porters@perl.org>.
=head1 COPYRIGHT
diff --git a/ext/IO/lib/IO/Socket.pm b/ext/IO/lib/IO/Socket.pm
index 894190fbee..0f46e8d65d 100644
--- a/ext/IO/lib/IO/Socket.pm
+++ b/ext/IO/lib/IO/Socket.pm
@@ -22,7 +22,7 @@ require IO::Socket::UNIX;
@ISA = qw(IO::Handle);
-$VERSION = "1.25";
+$VERSION = "1.251";
sub import {
my $pkg = shift;
@@ -101,39 +101,34 @@ sub connect {
my $addr = shift;
my $timeout = ${*$sock}{'io_socket_timeout'};
- eval {
- my $blocking = 0;
+ my $blocking;
+ $blocking = $sock->blocking(0) if $timeout;
+ eval {
croak 'connect: Bad address'
if(@_ == 2 && !defined $_[1]);
- $blocking = $sock->blocking(0)
- if($timeout);
-
unless(connect($sock, $addr)) {
if($timeout && ($! == &IO::EINPROGRESS)) {
require IO::Select;
my $sel = new IO::Select $sock;
- $sock->blocking(1)
- if($blocking);
-
unless($sel->can_write($timeout) && defined($sock->peername)) {
- undef $sock;
croak "connect: timeout";
}
}
else {
- undef $sock;
croak "connect: $!";
}
}
- $sock->blocking(1)
- if($sock && $blocking);
};
- $sock;
+ my $ret = $@ ? undef : $sock;
+
+ $sock->blocking($blocking) if $timeout;
+
+ $ret;
}
sub bind {
@@ -407,7 +402,8 @@ L<Socket>, L<IO::Handle>, L<IO::Socket::INET>, L<IO::Socket::UNIX>
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>
+Graham Barr. Currently maintained by the Perl Porters. Please report all
+bugs to <perl5-porters@perl.org>.
=head1 COPYRIGHT
diff --git a/ext/IO/lib/IO/Socket/INET.pm b/ext/IO/lib/IO/Socket/INET.pm
index ccd0e8f364..367959565d 100644
--- a/ext/IO/lib/IO/Socket/INET.pm
+++ b/ext/IO/lib/IO/Socket/INET.pm
@@ -368,7 +368,8 @@ L<Socket>, L<IO::Socket>
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>
+Graham Barr. Currently maintained by the Perl Porters. Please report all
+bugs to <perl5-porters@perl.org>.
=head1 COPYRIGHT
diff --git a/ext/IO/lib/IO/Socket/UNIX.pm b/ext/IO/lib/IO/Socket/UNIX.pm
index 7dc7d0ce22..8f3b31f42c 100644
--- a/ext/IO/lib/IO/Socket/UNIX.pm
+++ b/ext/IO/lib/IO/Socket/UNIX.pm
@@ -131,7 +131,8 @@ L<Socket>, L<IO::Socket>
=head1 AUTHOR
-Graham Barr E<lt>F<gbarr@pobox.com>E<gt>
+Graham Barr. Currently maintained by the Perl Porters. Please report all
+bugs to <perl5-porters@perl.org>.
=head1 COPYRIGHT
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index 070156bedc..08a1c66ccd 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -441,7 +441,12 @@ sub ExtUtils::MakeMaker::new {
}
if ($self->{PARENT}) {
$self->{PARENT}->{CHILDREN}->{$newclass} = $self;
- $self->{CAPI} = $self->{PARENT}->{CAPI};
+ if (exists $self->{PARENT}->{CAPI}
+ and not exists $self->{CAPI})
+ {
+ # inherit, but only if already unspecified
+ $self->{CAPI} = $self->{PARENT}->{CAPI};
+ }
}
} else {
parse_args($self,split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
@@ -1210,6 +1215,10 @@ currently used by MakeMaker but may be handy in Makefile.PLs.
Switch to force usage of the Perl C API even when compiling for PERL_OBJECT.
+Note that this attribute is passed through to any recursive build,
+but if and only if the submodule's Makefile.PL itself makes no mention
+of the 'CAPI' attribute.
+
=item CCFLAGS
String that will be included in the compiler call command line between
diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm
index 549bab5a8e..3988d46048 100644
--- a/lib/Pod/Text.pm
+++ b/lib/Pod/Text.pm
@@ -50,7 +50,7 @@ require Exporter;
@EXPORT = qw(pod2text);
use vars qw($VERSION);
-$VERSION = "1.0203";
+$VERSION = "1.0204";
use locale; # make \w work right in non-ASCII lands
@@ -274,7 +274,7 @@ sub prepare_for_output {
if (length() + 3 < $indent) {
my $paratag = $_;
$_ = <IN>;
- if (/^=/) { # tricked!
+ if (/^[=\s]/) { # tricked!, or verbatim paragraph
local($indent) = $indent[$#indent - 1] || $DEF_INDENT;
output($paratag);
redo POD_DIRECTIVE;
diff --git a/objXSUB.h b/objXSUB.h
index 0c4efd5456..8138d0df00 100644
--- a/objXSUB.h
+++ b/objXSUB.h
@@ -1387,6 +1387,8 @@
#define io_close pPerl->Perl_io_close
#undef is_an_int
#define is_an_int pPerl->Perl_is_an_int
+#undef is_handle_constructor
+#define is_handle_constructor pPerl->Perl_is_handle_constructor
#undef is_uni_alnum
#define is_uni_alnum pPerl->Perl_is_uni_alnum
#undef is_uni_alnum_lc
diff --git a/op.c b/op.c
index 8f15a10db3..412eb57c46 100644
--- a/op.c
+++ b/op.c
@@ -52,6 +52,7 @@ static PADOFFSET pad_findlex _((char* name, PADOFFSET newoff, U32 seq,
static OP *newDEFSVOP _((void));
static OP *new_logop _((I32 type, I32 flags, OP **firstp, OP **otherp));
static void simplify_sort _((OP *o));
+static bool is_handle_constructor _((OP *o, I32 argnum));
#endif
STATIC char*
@@ -1387,6 +1388,28 @@ scalar_mod_type(OP *o, I32 type)
}
}
+STATIC bool
+is_handle_constructor(OP *o, I32 argnum)
+{
+ switch (o->op_type) {
+ case OP_PIPE_OP:
+ case OP_SOCKPAIR:
+ if (argnum == 2)
+ return TRUE;
+ /* FALL THROUGH */
+ case OP_SYSOPEN:
+ case OP_OPEN:
+ case OP_SOCKET:
+ case OP_OPEN_DIR:
+ case OP_ACCEPT:
+ if (argnum == 1)
+ return TRUE;
+ /* FALL THROUGH */
+ default:
+ return FALSE;
+ }
+}
+
OP *
refkids(OP *o, I32 type)
{
@@ -1423,6 +1446,8 @@ ref(OP *o, I32 type)
ref(kid, type);
break;
case OP_RV2SV:
+ if (type == OP_DEFINED)
+ o->op_flags |= OPf_SPECIAL; /* don't create GV */
ref(cUNOPo->op_first, o->op_type);
/* FALL THROUGH */
case OP_PADSV:
@@ -1443,6 +1468,8 @@ ref(OP *o, I32 type)
o->op_flags |= OPf_REF;
/* FALL THROUGH */
case OP_RV2GV:
+ if (type == OP_DEFINED)
+ o->op_flags |= OPf_SPECIAL; /* don't create GV */
ref(cUNOPo->op_first, o->op_type);
break;
@@ -4675,7 +4702,7 @@ ck_fun(OP *o)
*tokid = kid;
}
else if (kid->op_type != OP_RV2AV && kid->op_type != OP_PADAV)
- bad_type(numargs, "array", PL_op_desc[o->op_type], kid);
+ bad_type(numargs, "array", PL_op_desc[type], kid);
mod(kid, type);
break;
case OA_HVREF:
@@ -4695,7 +4722,7 @@ ck_fun(OP *o)
*tokid = kid;
}
else if (kid->op_type != OP_RV2HV && kid->op_type != OP_PADHV)
- bad_type(numargs, "hash", PL_op_desc[o->op_type], kid);
+ bad_type(numargs, "hash", PL_op_desc[type], kid);
mod(kid, type);
break;
case OA_CVREF:
@@ -4725,8 +4752,12 @@ ck_fun(OP *o)
bad_type(numargs, "HANDLE", PL_op_desc[o->op_type], kid);
}
else {
+ I32 flags = OPf_SPECIAL;
+ /* is this op a FH constructor? */
+ if (is_handle_constructor(o,numargs))
+ flags = 0;
kid->op_sibling = 0;
- kid = newUNOP(OP_RV2GV, 0, scalar(kid));
+ kid = newUNOP(OP_RV2GV, flags, scalar(kid));
}
kid->op_sibling = sibl;
*tokid = kid;
diff --git a/perl.c b/perl.c
index c91c960632..9d47e22467 100644
--- a/perl.c
+++ b/perl.c
@@ -891,19 +891,25 @@ print \" \\@INC:\\n @INC\\n\";");
switch_end:
if (!PL_tainting && (s = PerlEnv_getenv("PERL5OPT"))) {
- while (s && *s) {
- while (isSPACE(*s))
- s++;
- if (*s == '-') {
- s++;
- if (isSPACE(*s))
- continue;
+ while (isSPACE(*s))
+ s++;
+ if (*s == '-' && *(s+1) == 'T')
+ PL_tainting = TRUE;
+ else {
+ while (s && *s) {
+ while (isSPACE(*s))
+ s++;
+ if (*s == '-') {
+ s++;
+ if (isSPACE(*s))
+ continue;
+ }
+ if (!*s)
+ break;
+ if (!strchr("DIMUdmw", *s))
+ croak("Illegal switch in PERL5OPT: -%c", *s);
+ s = moreswitches(s);
}
- if (!*s)
- break;
- if (!strchr("DIMUdmw", *s))
- croak("Illegal switch in PERL5OPT: -%c", *s);
- s = moreswitches(s);
}
}
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index eb84876d4e..c303c003a6 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -2323,6 +2323,11 @@ was either never opened or has since been closed.
(F) This machine doesn't implement the select() system call.
+=item select() on unopened file
+
+(W) You tried to use the select() function on a filehandle that
+was either never opened or has since been closed.
+
=item sem%s not implemented
(F) You don't have System V semaphore IPC on your system.
diff --git a/pod/perlguts.pod b/pod/perlguts.pod
index 551e84c8df..0b9eed0a8f 100644
--- a/pod/perlguts.pod
+++ b/pod/perlguts.pod
@@ -263,9 +263,9 @@ return value.
The C<av_clear> function deletes all the elements in the AV* array, but
does not actually delete the array itself. The C<av_undef> function will
delete all the elements in the array plus the array itself. The
-C<av_extend> function extends the array so that it contains C<key>
-elements. If C<key> is less than the current length of the array, then
-nothing is done.
+C<av_extend> function extends the array so that it contains at least C<key+1>
+elements. If C<key+1> is less than the currently allocated length of the array,
+then nothing is done.
If you know the name of an array variable, you can get a pointer to its AV
by using the following:
diff --git a/pod/perlre.pod b/pod/perlre.pod
index 451f527445..97ac7b7266 100644
--- a/pod/perlre.pod
+++ b/pod/perlre.pod
@@ -116,7 +116,11 @@ The following standard quantifiers are recognized:
(If a curly bracket occurs in any other context, it is treated
as a regular character.) The "*" modifier is equivalent to C<{0,}>, the "+"
modifier to C<{1,}>, and the "?" modifier to C<{0,1}>. n and m are limited
-to integral values less than 65536.
+to integral values less than a preset limit defined when perl is built.
+This is usually 32766 on the most common platforms. The actual limit can
+be seen in the error message generated by code such as this:
+
+ $_ **= $_ , / {$_} / for 2 .. 42;
By default, a quantified subpattern is "greedy", that is, it will match as
many times as possible (given a particular starting location) while still
diff --git a/pod/perlrun.pod b/pod/perlrun.pod
index 6ea5a1dbfb..8a572570cb 100644
--- a/pod/perlrun.pod
+++ b/pod/perlrun.pod
@@ -686,7 +686,8 @@ Command-line options (switches). Switches in this variable are taken
as if they were on every Perl command line. Only the B<-[DIMUdmw]>
switches are allowed. When running taint checks (because the script
was running setuid or setgid, or the B<-T> switch was used), this
-variable is ignored.
+variable is ignored. If PERL5OPT begins with B<-T>, tainting will be
+enabled, and any subsequent options ignored.
=item PERLLIB
diff --git a/pp.c b/pp.c
index 729d1e7ccc..83d881b58d 100644
--- a/pp.c
+++ b/pp.c
@@ -240,9 +240,18 @@ PP(pp_rv2gv)
RETSETUNDEF;
}
sym = SvPV(sv, n_a);
- if (PL_op->op_private & HINT_STRICT_REFS)
- DIE(PL_no_symref, sym, "a symbol");
- sv = (SV*)gv_fetchpv(sym, TRUE, SVt_PVGV);
+ if ((PL_op->op_flags & OPf_SPECIAL) &&
+ !(PL_op->op_flags & OPf_MOD))
+ {
+ sv = (SV*)gv_fetchpv(sym, FALSE, SVt_PVGV);
+ if (!sv)
+ RETSETUNDEF;
+ }
+ else {
+ if (PL_op->op_private & HINT_STRICT_REFS)
+ DIE(PL_no_symref, sym, "a symbol");
+ sv = (SV*)gv_fetchpv(sym, TRUE, SVt_PVGV);
+ }
}
}
if (PL_op->op_private & OPpLVAL_INTRO)
@@ -287,9 +296,18 @@ PP(pp_rv2sv)
RETSETUNDEF;
}
sym = SvPV(sv, n_a);
- if (PL_op->op_private & HINT_STRICT_REFS)
- DIE(PL_no_symref, sym, "a SCALAR");
- gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PV);
+ if ((PL_op->op_flags & OPf_SPECIAL) &&
+ !(PL_op->op_flags & OPf_MOD))
+ {
+ gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PV);
+ if (!gv)
+ RETSETUNDEF;
+ }
+ else {
+ if (PL_op->op_private & HINT_STRICT_REFS)
+ DIE(PL_no_symref, sym, "a SCALAR");
+ gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PV);
+ }
}
sv = GvSV(gv);
}
diff --git a/pp_hot.c b/pp_hot.c
index f304e8bd68..27af29d071 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -468,10 +468,20 @@ PP(pp_rv2av)
RETSETUNDEF;
}
sym = SvPV(sv,n_a);
- if (PL_op->op_private & HINT_STRICT_REFS)
- DIE(PL_no_symref, sym, "an ARRAY");
- gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVAV);
- } else {
+ if ((PL_op->op_flags & OPf_SPECIAL) &&
+ !(PL_op->op_flags & OPf_MOD))
+ {
+ gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PVAV);
+ if (!gv)
+ RETSETUNDEF;
+ }
+ else {
+ if (PL_op->op_private & HINT_STRICT_REFS)
+ DIE(PL_no_symref, sym, "an ARRAY");
+ gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVAV);
+ }
+ }
+ else {
gv = (GV*)sv;
}
av = GvAVn(gv);
@@ -558,10 +568,20 @@ PP(pp_rv2hv)
RETSETUNDEF;
}
sym = SvPV(sv,n_a);
- if (PL_op->op_private & HINT_STRICT_REFS)
- DIE(PL_no_symref, sym, "a HASH");
- gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVHV);
- } else {
+ if ((PL_op->op_flags & OPf_SPECIAL) &&
+ !(PL_op->op_flags & OPf_MOD))
+ {
+ gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PVHV);
+ if (!gv)
+ RETSETUNDEF;
+ }
+ else {
+ if (PL_op->op_private & HINT_STRICT_REFS)
+ DIE(PL_no_symref, sym, "a HASH");
+ gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVHV);
+ }
+ }
+ else {
gv = (GV*)sv;
}
hv = GvHVn(gv);
diff --git a/pp_sys.c b/pp_sys.c
index a35a2060b9..e4694bcfb6 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1003,8 +1003,13 @@ PP(pp_select)
}
if (newdefout) {
- if (!GvIO(newdefout))
- gv_IOadd(newdefout);
+ if (!GvIO(newdefout)) {
+ if (ckWARN(WARN_UNOPENED))
+ warner(WARN_UNOPENED, "select() on unopened file");
+ if (SvTYPE(newdefout) != SVt_PVGV)
+ RETURN;
+ gv_IOadd(newdefout); /* XXX probably bogus */
+ }
setdefout(newdefout);
}
diff --git a/proto.h b/proto.h
index f91e80bc5b..7e3d4c5862 100644
--- a/proto.h
+++ b/proto.h
@@ -894,6 +894,7 @@ void debprof _((OP *o));
void *bset_obj_store _((void *obj, I32 ix));
OP *new_logop _((I32 type, I32 flags, OP **firstp, OP **otherp));
void simplify_sort _((OP *o));
+bool is_handle_constructor _((OP *o, I32 argnum));
I32 do_trans_CC_simple _((SV *sv));
I32 do_trans_CC_count _((SV *sv));
diff --git a/t/op/fh.t b/t/op/fh.t
new file mode 100755
index 0000000000..d2659c3b9a
--- /dev/null
+++ b/t/op/fh.t
@@ -0,0 +1,24 @@
+#!./perl
+
+print "1..5\n";
+
+my $test = 0;
+
+# symbolic filehandles should only result in glob entries with FH constructors
+
+my $a = "SYM000";
+print "not " if defined(fileno($a)) or defined *{$a};
+++$test; print "ok $test\n";
+
+select select $a;
+print "not " if defined *{$a};
+++$test; print "ok $test\n";
+
+print "not " if close $a or defined *{$a};
+++$test; print "ok $test\n";
+
+print "not " unless open($a, ">&STDOUT") and defined *{$a};
+++$test; print $a "ok $test\n";
+
+print "not " unless close $a;
+++$test; print $a "not "; print "ok $test\n";
diff --git a/t/op/gv.t b/t/op/gv.t
index c253e4bd9d..df4984e80c 100755
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -4,7 +4,7 @@
# various typeglob tests
#
-print "1..23\n";
+print "1..29\n";
# type coersion on assignment
$foo = 'foo';
@@ -95,4 +95,29 @@ print *{*x{GLOB}} eq "*main::STDOUT" ? "ok 21\n" : "not ok 21\n";
print {*x{IO}} "ok 22\n";
print {*x{FILEHANDLE}} "ok 23\n";
+# test if defined() doesn't create any new symbols
+
+{
+ my $test = 23;
+
+ my $a = "SYM000";
+ print "not " if defined *{$a};
+ ++$test; print "ok $test\n";
+
+ print "not " if defined @{$a} or defined *{$a};
+ ++$test; print "ok $test\n";
+
+ print "not " if defined %{$a} or defined *{$a};
+ ++$test; print "ok $test\n";
+
+ print "not " if defined ${$a} or defined *{$a};
+ ++$test; print "ok $test\n";
+
+ print "not " if defined &{$a} or defined *{$a};
+ ++$test; print "ok $test\n";
+
+ *{$a} = sub { print "ok $test\n" };
+ print "not " unless defined &{$a} and defined *{$a};
+ ++$test; &{$a};
+}
diff --git a/t/op/misc.t b/t/op/misc.t
index 9fe98c4589..57d57b7b37 100755
--- a/t/op/misc.t
+++ b/t/op/misc.t
@@ -411,7 +411,13 @@ destroyed
package X;
sub any { bless {} }
my $f = "FH000"; # just to thwart any future optimisations
-sub afh { select select ++$f; my $r = *{$f}{IO}; delete $X::{$f}; bless $r }
+sub afh {
+ open(++$f, '>&STDOUT') or die;
+ select select $f;
+ my $r = *{$f}{IO};
+ delete $X::{$f};
+ bless $r;
+}
sub DESTROY { print "destroyed\n" }
package main;
$x = any X; # to bump sv_objcount. IO objs aren't counted??
diff --git a/utils/perldoc.PL b/utils/perldoc.PL
index 4fff93452f..26335101c0 100644
--- a/utils/perldoc.PL
+++ b/utils/perldoc.PL
@@ -188,7 +188,7 @@ sub minus_f_nocase {
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
# that is it all we can do
- warn "Ignored $file: unreadable\n" if -f _;
+ warn "Ignored $path: unreadable\n" if -f _;
return '';
}
local *DIR;
@@ -227,7 +227,7 @@ sub minus_f_nocase {
return "" unless $found;
push @p, $cip;
return "@p" if -f "@p" and -r _;
- warn "Ignored $file: unreadable\n" if -f _;
+ warn "Ignored @p: unreadable\n" if -f _;
}
}
return "";
diff --git a/win32/pod.mak b/win32/pod.mak
index e16cf8e80a..7476c33748 100644
--- a/win32/pod.mak
+++ b/win32/pod.mak
@@ -22,6 +22,7 @@ POD = \
perlre.pod \
perlrun.pod \
perlfunc.pod \
+ perlopentut.pod \
perlvar.pod \
perlsub.pod \
perlmod.pod \
@@ -38,6 +39,7 @@ POD = \
perltie.pod \
perlbot.pod \
perlipc.pod \
+ perlthrtut.pod \
perldebug.pod \
perldiag.pod \
perlsec.pod \
@@ -74,6 +76,7 @@ MAN = \
perlre.man \
perlrun.man \
perlfunc.man \
+ perlopentut.man \
perlvar.man \
perlsub.man \
perlmod.man \
@@ -82,6 +85,7 @@ MAN = \
perlform.man \
perllocale.man \
perlref.man \
+ perlreftut.man \
perldsc.man \
perllol.man \
perltoot.man \
@@ -89,6 +93,7 @@ MAN = \
perltie.man \
perlbot.man \
perlipc.man \
+ perlthrtut.man \
perldebug.man \
perldiag.man \
perlsec.man \
@@ -125,6 +130,7 @@ HTML = \
perlre.html \
perlrun.html \
perlfunc.html \
+ perlopentut.html \
perlvar.html \
perlsub.html \
perlmod.html \
@@ -133,6 +139,7 @@ HTML = \
perlform.html \
perllocale.html \
perlref.html \
+ perlreftut.html \
perldsc.html \
perllol.html \
perltoot.html \
@@ -140,6 +147,7 @@ HTML = \
perltie.html \
perlbot.html \
perlipc.html \
+ perlthrtut.html \
perldebug.html \
perldiag.html \
perlsec.html \
@@ -176,6 +184,7 @@ TEX = \
perlre.tex \
perlrun.tex \
perlfunc.tex \
+ perlopentut.tex \
perlvar.tex \
perlsub.tex \
perlmod.tex \
@@ -184,6 +193,7 @@ TEX = \
perlform.tex \
perllocale.tex \
perlref.tex \
+ perlreftut.tex \
perldsc.tex \
perllol.tex \
perltoot.tex \
@@ -191,6 +201,7 @@ TEX = \
perltie.tex \
perlbot.tex \
perlipc.tex \
+ perlthrtut.tex \
perldebug.tex \
perldiag.tex \
perlsec.tex \