summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes127
-rw-r--r--doio.c186
-rw-r--r--dosish.h2
-rw-r--r--embed.h20
-rwxr-xr-xembed.pl7
-rw-r--r--epoc/epocish.h2
-rw-r--r--ext/Data/Dumper/Dumper.pm32
-rw-r--r--ext/Data/Dumper/Dumper.xs16
-rw-r--r--global.sym3
-rw-r--r--hints/hpux.sh18
-rw-r--r--hints/solaris_2.sh23
-rwxr-xr-xlib/ExtUtils/xsubpp22
-rw-r--r--lib/bytes.pm2
-rw-r--r--lib/open.pm70
-rw-r--r--lib/perl5db.pl66
-rw-r--r--lib/utf8.pm2
-rw-r--r--mpeix/mpeixish.h2
-rw-r--r--objXSUB.h12
-rw-r--r--op.c124
-rw-r--r--op.h11
-rw-r--r--opcode.h4
-rwxr-xr-xopcode.pl4
-rw-r--r--os2/os2ish.h2
-rw-r--r--perl.h14
-rwxr-xr-xperlapi.c28
-rw-r--r--plan9/plan9ish.h2
-rw-r--r--pod/perldebug.pod8
-rw-r--r--pod/perldelta.pod99
-rw-r--r--pod/perlfunc.pod25
-rw-r--r--pod/perlhist.pod1
-rw-r--r--pod/perlunicode.pod75
-rw-r--r--pp.sym1
-rw-r--r--pp_ctl.c5
-rw-r--r--pp_proto.h1
-rw-r--r--pp_sys.c38
-rw-r--r--proto.h12
-rwxr-xr-xt/comp/require.t15
-rw-r--r--universal.c6
-rw-r--r--utf8.c7
-rw-r--r--vms/vmsish.h2
-rw-r--r--vos/vosish.h2
-rw-r--r--win32/win32.c16
-rw-r--r--win32/win32.h17
43 files changed, 848 insertions, 283 deletions
diff --git a/Changes b/Changes
index 3eb6f9ef18..6f54029359 100644
--- a/Changes
+++ b/Changes
@@ -95,6 +95,133 @@ Version v5.6.0
--------------
____________________________________________________________________________
+[ 5631] By: gsar on 2000/03/09 18:49:12
+ Log: track more of the child state on Windows
+ Branch: perl
+ ! win32/win32.c win32/win32.h
+____________________________________________________________________________
+[ 5630] By: gsar on 2000/03/09 18:48:05
+ Log: UNIVERSAL::isa() and UNIVERSAL::can() fail for magic values
+ Branch: perl
+ ! universal.c
+____________________________________________________________________________
+[ 5629] By: gsar on 2000/03/09 18:37:35
+ Log: tweak Unicode notes, other cleanups
+ Branch: perl
+ ! Changes lib/bytes.pm lib/utf8.pm pod/perldelta.pod
+ ! pod/perlhist.pod pod/perlunicode.pod
+____________________________________________________________________________
+[ 5628] By: gsar on 2000/03/09 17:39:58
+ Log: support binmode(F,":crlf") and use open IN => ":raw", OUT => ":crlf"
+ semantics; the pragma sets defaults for both open() and qx//
+ Branch: perl
+ ! doio.c dosish.h embed.h embed.pl epoc/epocish.h lib/open.pm
+ ! mpeix/mpeixish.h op.c op.h opcode.h opcode.pl os2/os2ish.h
+ ! perl.h perlapi.c plan9/plan9ish.h pod/perlfunc.pod pp.sym
+ ! pp_proto.h pp_sys.c proto.h sv.h vms/vmsish.h vos/vosish.h
+____________________________________________________________________________
+[ 5627] By: gsar on 2000/03/09 12:54:08
+ Log: avoid autoflushing behavior of fork/system/exec on Solaris (thanks
+ to fflush(NULL) bug)
+ Branch: perl
+ ! hints/solaris_2.sh pod/perldelta.pod
+____________________________________________________________________________
+[ 5626] By: gsar on 2000/03/09 11:34:51
+ Log: abort build on HP-UX if bundled non-ANSI compiler is detected
+ (from Dominic Dunlop <domo@computer.org>)
+ Branch: perl
+ ! hints/hpux.sh
+____________________________________________________________________________
+[ 5625] By: gsar on 2000/03/09 11:17:07
+ Log: patch from Larry to make -T filetest algorithm recognize utf8 as
+ "text"
+ Branch: perl
+ ! pp_sys.c
+____________________________________________________________________________
+[ 5624] By: gsar on 2000/03/09 11:11:59
+ Log: provide support for deleting actions etc. (from Ronald J Kimball
+ <rjk@linguist.dartmouth.edu>)
+ Branch: perl
+ ! lib/perl5db.pl pod/perldebug.pod
+____________________________________________________________________________
+[ 5623] By: gsar on 2000/03/09 06:39:21
+ Log: new xsubpp keywords should be in all caps
+ Branch: perl
+ ! lib/ExtUtils/xsubpp
+____________________________________________________________________________
+[ 5622] By: gsar on 2000/03/09 06:26:04
+ Log: demand-load utf8.pm in swash routines
+ Branch: perl
+ ! op.c utf8.c
+____________________________________________________________________________
+[ 5621] By: gsar on 2000/03/08 19:27:02
+ Log: make Dump() call the XSUB implementation transparently (modified
+ version of patch suggested by David Boyce <dsb@world.std.com>)
+ Branch: perl
+ ! ext/Data/Dumper/Dumper.pm ext/Data/Dumper/Dumper.xs
+ ! pod/perldelta.pod
+____________________________________________________________________________
+[ 5620] By: gsar on 2000/03/08 18:35:48
+ Log: do FILE should not see outside lexicals (from Rick Delaney
+ <rick@consumercontact.com>)
+ Branch: perl
+ ! op.c pp_ctl.c t/comp/require.t
+____________________________________________________________________________
+[ 5619] By: gsar on 2000/03/08 18:04:45
+ Log: abstract code for C<use Foo 1.23 @ary;> into a Perl_load_module()
+ API function
+ Branch: perl
+ ! doio.c embed.h embed.pl global.sym objXSUB.h op.c op.h
+ ! perlapi.c pp_sys.c proto.h
+____________________________________________________________________________
+[ 5618] By: jhi on 2000/03/08 18:03:30
+ Log: Integrate with Sarathy.
+ Branch: cfgperl
+ +> lib/Pod/Plainer.pm
+ !> Changes MANIFEST dosish.h embedvar.h lib/Pod/InputObjects.pm
+ !> lib/Pod/Parser.pm makedef.pl op.c op.h perl.c perlapi.h
+ !> perlvars.h pod/perlop.pod pod/pod2latex.PL sv.c unixish.h
+ !> vms/vmsish.h
+____________________________________________________________________________
+[ 5617] By: jhi on 2000/03/08 15:44:05
+ Log: ICU todo fixes.
+ Branch: cfgperl
+ ! Todo-5.6
+____________________________________________________________________________
+[ 5616] By: jhi on 2000/03/08 14:30:40
+ Log: Even more Todo.
+ Branch: cfgperl
+ ! Todo-5.6
+____________________________________________________________________________
+[ 5615] By: jhi on 2000/03/08 14:13:45
+ Log: More Todo.
+ Branch: cfgperl
+ ! Todo-5.6
+____________________________________________________________________________
+[ 5614] By: jhi on 2000/03/08 13:50:53
+ Log: wording changes
+ Branch: cfgperl
+ ! lib/Math/Complex.pm
+____________________________________________________________________________
+[ 5613] By: gsar on 2000/03/08 12:51:35
+ Log: clarify docs on return value from binding operators
+ Branch: perl
+ ! pod/perlop.pod
+____________________________________________________________________________
+[ 5612] By: gsar on 2000/03/08 12:41:38
+ Log: shore up pod2latex shortcomings, and a Pod::Parser fix (from
+ Robin Barker)
+ Branch: perl
+ + lib/Pod/Plainer.pm
+ ! MANIFEST lib/Pod/Parser.pm pod/pod2latex.PL
+____________________________________________________________________________
+[ 5611] By: gsar on 2000/03/08 12:22:59
+ Log: integrate cfgperl changes into mainline
+ Branch: perl
+ ! Changes
+ !> installperl lib/Math/Complex.pm pod/perldelta.pod
+ !> t/lib/complex.t vms/vmsish.h
+____________________________________________________________________________
[ 5610] By: gsar on 2000/03/08 12:08:17
Log: add missing locks for op refcounts
Branch: perl
diff --git a/doio.c b/doio.c
index 3cd199b7aa..5c86537e8f 100644
--- a/doio.c
+++ b/doio.c
@@ -93,9 +93,19 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
int fd;
int result;
bool was_fdopen = FALSE;
+ bool in_raw = 0, in_crlf = 0, out_raw = 0, out_crlf = 0;
PL_forkprocess = 1; /* assume true if no fork */
+ if (PL_op && PL_op->op_type == OP_OPEN) {
+ /* set up disciplines */
+ U8 flags = PL_op->op_private;
+ in_raw = (flags & OPpOPEN_IN_RAW);
+ in_crlf = (flags & OPpOPEN_IN_CRLF);
+ out_raw = (flags & OPpOPEN_OUT_RAW);
+ out_crlf = (flags & OPpOPEN_OUT_CRLF);
+ }
+
if (IoIFP(io)) {
fd = PerlIO_fileno(IoIFP(io));
if (IoTYPE(io) == '-')
@@ -153,15 +163,28 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
if (fd == -1)
fp = NULL;
else {
- char *fpmode;
+ char fpmode[4];
+ STRLEN ix = 0;
if (result == O_RDONLY)
- fpmode = "r";
+ fpmode[ix++] = 'r';
#ifdef O_APPEND
- else if (rawmode & O_APPEND)
- fpmode = (result == O_WRONLY) ? "a" : "a+";
+ else if (rawmode & O_APPEND) {
+ fpmode[ix++] = 'a';
+ if (result != O_WRONLY)
+ fpmode[ix++] = '+';
+ }
#endif
- else
- fpmode = (result == O_WRONLY) ? "w" : "r+";
+ else {
+ if (result == O_WRONLY)
+ fpmode[ix++] = 'w';
+ else {
+ fpmode[ix++] = 'r';
+ fpmode[ix++] = '+';
+ }
+ }
+ if (rawmode & O_BINARY)
+ fpmode[ix++] = 'b';
+ fpmode[ix] = '\0';
fp = PerlIO_fdopen(fd, fpmode);
if (!fp)
PerlLIO_close(fd);
@@ -172,7 +195,7 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
char *oname = name;
STRLEN tlen;
STRLEN olen = len;
- char mode[3]; /* stdio file mode ("r\0" or "r+\0") */
+ char mode[4]; /* stdio file mode ("r\0", "rb\0", "r+b\0" etc.) */
int dodup;
type = savepvn(name, len);
@@ -191,7 +214,7 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
name = type;
len = tlen;
}
- mode[0] = mode[1] = mode[2] = '\0';
+ mode[0] = mode[1] = mode[2] = mode[3] = '\0';
IoTYPE(io) = *type;
if (*type == '+' && tlen > 1 && type[tlen-1] != '|') { /* scary */
mode[1] = *type++;
@@ -226,7 +249,16 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
if (ckWARN(WARN_PIPE))
Perl_warner(aTHX_ WARN_PIPE, "Can't open bidirectional pipe");
}
- fp = PerlProc_popen(name,"w");
+ {
+ char *mode;
+ if (out_raw)
+ mode = "wb";
+ else if (out_crlf)
+ mode = "wt";
+ else
+ mode = "w";
+ fp = PerlProc_popen(name,mode);
+ }
writing = 1;
}
else if (*type == '>') {
@@ -241,6 +273,11 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
mode[0] = 'w';
writing = 1;
+ if (out_raw)
+ strcat(mode, "b");
+ else if (out_crlf)
+ strcat(mode, "t");
+
if (num_svs && tlen != 1)
goto unknown_desr;
if (*type == '&') {
@@ -317,6 +354,11 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
/*SUPPRESS 530*/
for (type++; isSPACE(*type); type++) ;
mode[0] = 'r';
+ if (in_raw)
+ strcat(mode, "b");
+ else if (in_crlf)
+ strcat(mode, "t");
+
if (*type == '&') {
name = type;
goto duplicity;
@@ -351,7 +393,16 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
if (strNE(name,"-") || num_svs)
TAINT_ENV();
TAINT_PROPER("piped open");
- fp = PerlProc_popen(name,"r");
+ {
+ char *mode;
+ if (in_raw)
+ mode = "rb";
+ else if (in_crlf)
+ mode = "rt";
+ else
+ mode = "r";
+ fp = PerlProc_popen(name,mode);
+ }
IoTYPE(io) = '|';
}
else {
@@ -365,8 +416,16 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
fp = PerlIO_stdin();
IoTYPE(io) = '-';
}
- else
- fp = PerlIO_open(name,"r");
+ else {
+ char *mode;
+ if (in_raw)
+ mode = "rb";
+ else if (in_crlf)
+ mode = "rt";
+ else
+ mode = "r";
+ fp = PerlIO_open(name,mode);
+ }
}
}
if (!fp) {
@@ -444,8 +503,17 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
if (writing) {
dTHR;
if (IoTYPE(io) == 's'
- || (IoTYPE(io) == '>' && S_ISCHR(PL_statbuf.st_mode)) ) {
- if (!(IoOFP(io) = PerlIO_fdopen(PerlIO_fileno(fp),"w"))) {
+ || (IoTYPE(io) == '>' && S_ISCHR(PL_statbuf.st_mode)) )
+ {
+ char *mode;
+ if (out_raw)
+ mode = "wb";
+ else if (out_crlf)
+ mode = "wt";
+ else
+ mode = "w";
+
+ if (!(IoOFP(io) = PerlIO_fdopen(PerlIO_fileno(fp),mode))) {
PerlIO_close(fp);
IoIFP(io) = Nullfp;
goto say_false;
@@ -902,19 +970,72 @@ Perl_do_sysseek(pTHX_ GV *gv, Off_t pos, int whence)
}
int
-Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int flag)
+Perl_mode_from_discipline(pTHX_ SV *discp)
+{
+ int mode = O_BINARY;
+ if (discp) {
+ STRLEN len;
+ char *s = SvPV(discp,len);
+ while (*s) {
+ if (*s == ':') {
+ switch (s[1]) {
+ case 'r':
+ if (len > 3 && strnEQ(s+1, "raw", 3)
+ && (!s[4] || s[4] == ':' || isSPACE(s[4])))
+ {
+ mode = O_BINARY;
+ s += 4;
+ len -= 4;
+ break;
+ }
+ /* FALL THROUGH */
+ case 'c':
+ if (len > 4 && strnEQ(s+1, "crlf", 4)
+ && (!s[5] || s[5] == ':' || isSPACE(s[5])))
+ {
+ mode = O_TEXT;
+ s += 5;
+ len -= 5;
+ break;
+ }
+ /* FALL THROUGH */
+ default:
+ goto fail_discipline;
+ }
+ }
+ else if (isSPACE(*s)) {
+ ++s;
+ --len;
+ }
+ else {
+ char *end;
+fail_discipline:
+ end = strchr(s+1, ':');
+ if (!end)
+ end = s+len;
+ Perl_croak(aTHX_ "Unknown discipline '%.*s'", end-s, s);
+ }
+ }
+ }
+ return mode;
+}
+
+int
+Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode)
{
- if (flag != TRUE)
- Perl_croak(aTHX_ "panic: unsetting binmode"); /* Not implemented yet */
#ifdef DOSISH
-#if defined(atarist) || defined(__MINT__)
- if (!PerlIO_flush(fp) && (fp->_flag |= _IOBIN))
+# if defined(atarist) || defined(__MINT__)
+ if (!PerlIO_flush(fp)) {
+ if (mode & O_BINARY)
+ ((FILE*)fp)->_flag |= _IOBIN;
+ else
+ ((FILE*)fp)->_flag &= ~ _IOBIN;
return 1;
- else
- return 0;
-#else
- if (PerlLIO_setmode(PerlIO_fileno(fp), OP_BINARY) != -1) {
-#if defined(WIN32) && defined(__BORLANDC__)
+ }
+ return 0;
+# else
+ if (PerlLIO_setmode(PerlIO_fileno(fp), mode) != -1) {
+# if defined(WIN32) && defined(__BORLANDC__)
/* The translation mode of the stream is maintained independent
* of the translation mode of the fd in the Borland RTL (heavy
* digging through their runtime sources reveal). User has to
@@ -922,22 +1043,25 @@ Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int flag)
* document this anywhere). GSAR 97-5-24
*/
PerlIO_seek(fp,0L,0);
- ((FILE*)fp)->flags |= _F_BIN;
-#endif
+ if (mode & O_BINARY)
+ ((FILE*)fp)->flags |= _F_BIN;
+ else
+ ((FILE*)fp)->flags &= ~ _F_BIN;
+# endif
return 1;
}
else
return 0;
-#endif
+# endif
#else
-#if defined(USEMYBINMODE)
- if (my_binmode(fp,iotype) != FALSE)
+# if defined(USEMYBINMODE)
+ if (my_binmode(fp, iotype, mode) != FALSE)
return 1;
else
return 0;
-#else
+# else
return 1;
-#endif
+# endif
#endif
}
diff --git a/dosish.h b/dosish.h
index be7020d121..08b48fa0fe 100644
--- a/dosish.h
+++ b/dosish.h
@@ -52,7 +52,7 @@
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
diff --git a/embed.h b/embed.h
index 3b3a83659b..b597558482 100644
--- a/embed.h
+++ b/embed.h
@@ -116,6 +116,7 @@
#define die_nocontext Perl_die_nocontext
#define deb_nocontext Perl_deb_nocontext
#define form_nocontext Perl_form_nocontext
+#define load_module_nocontext Perl_load_module_nocontext
#define mess_nocontext Perl_mess_nocontext
#define warn_nocontext Perl_warn_nocontext
#define warner_nocontext Perl_warner_nocontext
@@ -322,6 +323,8 @@
#define linklist Perl_linklist
#define list Perl_list
#define listkids Perl_listkids
+#define load_module Perl_load_module
+#define vload_module Perl_vload_module
#define localize Perl_localize
#define looks_like_number Perl_looks_like_number
#define magic_clearenv Perl_magic_clearenv
@@ -392,6 +395,7 @@
#define mg_set Perl_mg_set
#define mg_size Perl_mg_size
#define mod Perl_mod
+#define mode_from_discipline Perl_mode_from_discipline
#define moreswitches Perl_moreswitches
#define my Perl_my
#define my_atof Perl_my_atof
@@ -1138,6 +1142,7 @@
#define ck_match Perl_ck_match
#define ck_method Perl_ck_method
#define ck_null Perl_ck_null
+#define ck_open Perl_ck_open
#define ck_repeat Perl_ck_repeat
#define ck_require Perl_ck_require
#define ck_rfun Perl_ck_rfun
@@ -1762,6 +1767,7 @@
#define linklist(a) Perl_linklist(aTHX_ a)
#define list(a) Perl_list(aTHX_ a)
#define listkids(a) Perl_listkids(aTHX_ a)
+#define vload_module(a,b,c,d) Perl_vload_module(aTHX_ a,b,c,d)
#define localize(a,b) Perl_localize(aTHX_ a,b)
#define looks_like_number(a) Perl_looks_like_number(aTHX_ a)
#define magic_clearenv(a,b) Perl_magic_clearenv(aTHX_ a,b)
@@ -1831,6 +1837,7 @@
#define mg_set(a) Perl_mg_set(aTHX_ a)
#define mg_size(a) Perl_mg_size(aTHX_ a)
#define mod(a,b) Perl_mod(aTHX_ a,b)
+#define mode_from_discipline(a) Perl_mode_from_discipline(aTHX_ a)
#define moreswitches(a) Perl_moreswitches(aTHX_ a)
#define my(a) Perl_my(aTHX_ a)
#define my_atof(a) Perl_my_atof(aTHX_ a)
@@ -2567,6 +2574,7 @@
#define ck_match(a) Perl_ck_match(aTHX_ a)
#define ck_method(a) Perl_ck_method(aTHX_ a)
#define ck_null(a) Perl_ck_null(aTHX_ a)
+#define ck_open(a) Perl_ck_open(aTHX_ a)
#define ck_repeat(a) Perl_ck_repeat(aTHX_ a)
#define ck_require(a) Perl_ck_require(aTHX_ a)
#define ck_rfun(a) Perl_ck_rfun(aTHX_ a)
@@ -3055,6 +3063,8 @@
#define deb_nocontext Perl_deb_nocontext
#define Perl_form_nocontext CPerlObj::Perl_form_nocontext
#define form_nocontext Perl_form_nocontext
+#define Perl_load_module_nocontext CPerlObj::Perl_load_module_nocontext
+#define load_module_nocontext Perl_load_module_nocontext
#define Perl_mess_nocontext CPerlObj::Perl_mess_nocontext
#define mess_nocontext Perl_mess_nocontext
#define Perl_warn_nocontext CPerlObj::Perl_warn_nocontext
@@ -3456,6 +3466,10 @@
#define list Perl_list
#define Perl_listkids CPerlObj::Perl_listkids
#define listkids Perl_listkids
+#define Perl_load_module CPerlObj::Perl_load_module
+#define load_module Perl_load_module
+#define Perl_vload_module CPerlObj::Perl_vload_module
+#define vload_module Perl_vload_module
#define Perl_localize CPerlObj::Perl_localize
#define localize Perl_localize
#define Perl_looks_like_number CPerlObj::Perl_looks_like_number
@@ -3590,6 +3604,8 @@
#define mg_size Perl_mg_size
#define Perl_mod CPerlObj::Perl_mod
#define mod Perl_mod
+#define Perl_mode_from_discipline CPerlObj::Perl_mode_from_discipline
+#define mode_from_discipline Perl_mode_from_discipline
#define Perl_moreswitches CPerlObj::Perl_moreswitches
#define moreswitches Perl_moreswitches
#define Perl_my CPerlObj::Perl_my
@@ -4981,6 +4997,8 @@
#define ck_method Perl_ck_method
#define Perl_ck_null CPerlObj::Perl_ck_null
#define ck_null Perl_ck_null
+#define Perl_ck_open CPerlObj::Perl_ck_open
+#define ck_open Perl_ck_open
#define Perl_ck_repeat CPerlObj::Perl_ck_repeat
#define ck_repeat Perl_ck_repeat
#define Perl_ck_require CPerlObj::Perl_ck_require
@@ -5751,6 +5769,7 @@
# define deb Perl_deb_nocontext
# define die Perl_die_nocontext
# define form Perl_form_nocontext
+# define load_module Perl_load_module_nocontext
# define mess Perl_mess_nocontext
# define newSVpvf Perl_newSVpvf_nocontext
# define sv_catpvf Perl_sv_catpvf_nocontext
@@ -5769,6 +5788,7 @@
# define Perl_die_nocontext Perl_die
# define Perl_deb_nocontext Perl_deb
# define Perl_form_nocontext Perl_form
+# define Perl_load_module_nocontext Perl_load_module
# define Perl_mess_nocontext Perl_mess
# define Perl_newSVpvf_nocontext Perl_newSVpvf
# define Perl_sv_catpvf_nocontext Perl_sv_catpvf
diff --git a/embed.pl b/embed.pl
index 2783805472..8b6c887dc4 100755
--- a/embed.pl
+++ b/embed.pl
@@ -500,6 +500,7 @@ print EM <<'END';
# define deb Perl_deb_nocontext
# define die Perl_die_nocontext
# define form Perl_form_nocontext
+# define load_module Perl_load_module_nocontext
# define mess Perl_mess_nocontext
# define newSVpvf Perl_newSVpvf_nocontext
# define sv_catpvf Perl_sv_catpvf_nocontext
@@ -518,6 +519,7 @@ print EM <<'END';
# define Perl_die_nocontext Perl_die
# define Perl_deb_nocontext Perl_deb
# define Perl_form_nocontext Perl_form
+# define Perl_load_module_nocontext Perl_load_module
# define Perl_mess_nocontext Perl_mess
# define Perl_newSVpvf_nocontext Perl_newSVpvf
# define Perl_sv_catpvf_nocontext Perl_sv_catpvf
@@ -931,6 +933,7 @@ my %vfuncs = qw(
Perl_warner Perl_vwarner
Perl_die Perl_vdie
Perl_form Perl_vform
+ Perl_load_module Perl_vload_module
Perl_mess Perl_vmess
Perl_deb Perl_vdeb
Perl_newSVpvf Perl_vnewSVpvf
@@ -1399,6 +1402,7 @@ Afnrp |void |croak_nocontext|const char* pat|...
Afnp |OP* |die_nocontext |const char* pat|...
Afnp |void |deb_nocontext |const char* pat|...
Afnp |char* |form_nocontext |const char* pat|...
+Afnp |void |load_module_nocontext|U32 flags|SV* name|SV* ver|...
Afnp |SV* |mess_nocontext |const char* pat|...
Afnp |void |warn_nocontext |const char* pat|...
Afnp |void |warner_nocontext|U32 err|const char* pat|...
@@ -1616,6 +1620,8 @@ p |void |lex_start |SV* line
p |OP* |linklist |OP* o
p |OP* |list |OP* o
p |OP* |listkids |OP* o
+Afp |void |load_module|U32 flags|SV* name|SV* ver|...
+Ap |void |vload_module|U32 flags|SV* name|SV* ver|va_list* args
p |OP* |localize |OP* arg|I32 lexical
Apd |I32 |looks_like_number|SV* sv
p |int |magic_clearenv |SV* sv|MAGIC* mg
@@ -1686,6 +1692,7 @@ Apd |void |mg_magical |SV* sv
Apd |int |mg_set |SV* sv
Ap |I32 |mg_size |SV* sv
p |OP* |mod |OP* o|I32 type
+p |int |mode_from_discipline|SV* discp
Ap |char* |moreswitches |char* s
p |OP* |my |OP* o
Ap |NV |my_atof |const char *s
diff --git a/epoc/epocish.h b/epoc/epocish.h
index ca992cfdfb..f4be0ff677 100644
--- a/epoc/epocish.h
+++ b/epoc/epocish.h
@@ -36,7 +36,7 @@
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm
index c86299c619..93b87f9aba 100644
--- a/ext/Data/Dumper/Dumper.pm
+++ b/ext/Data/Dumper/Dumper.pm
@@ -146,11 +146,17 @@ sub Names {
sub DESTROY {}
+sub Dump {
+ return &Dumpxs
+ unless $Data::Dumper::Useqq || (ref($_[0]) && $_[0]->{useqq});
+ return &Dumpperl;
+}
+
#
# dump the refs in the current dumper object.
# expects same args as new() if called via package name.
#
-sub Dump {
+sub Dumpperl {
my($s) = shift;
my(@out, $val, $name);
my($i) = 0;
@@ -440,9 +446,7 @@ sub Dumper {
return Data::Dumper->Dump([@_]);
}
-#
-# same, only calls the XS version
-#
+# compat stub
sub DumperX {
return Data::Dumper->Dumpxs([@_], []);
}
@@ -687,12 +691,6 @@ of strings corresponding to the supplied values.
The second form, for convenience, simply calls the C<new> method on its
arguments before dumping the object immediately.
-=item I<$OBJ>->Dumpxs I<or> I<PACKAGE>->Dumpxs(I<ARRAYREF [>, I<ARRAYREF]>)
-
-This method is available if you were able to compile and install the XSUB
-extension to C<Data::Dumper>. It is exactly identical to the C<Dump> method
-above, only about 4 to 5 times faster, since it is written entirely in C.
-
=item I<$OBJ>->Seen(I<[HASHREF]>)
Queries or adds to the internal table of already encountered references.
@@ -736,12 +734,6 @@ configuration options below. The values will be named C<$VAR>I<n> in the
output, where I<n> is a numeric suffix. Will return a list of strings
in an array context.
-=item DumperX(I<LIST>)
-
-Identical to the C<Dumper()> function above, but this calls the XSUB
-implementation. Only available if you were able to compile and install
-the XSUB extensions in C<Data::Dumper>.
-
=back
=head2 Configuration Variables or Methods
@@ -797,8 +789,8 @@ When set, enables the use of double quotes for representing string values.
Whitespace other than space will be represented as C<[\n\t\r]>, "unsafe"
characters will be backslashed, and unprintable characters will be output as
quoted octal integers. Since setting this variable imposes a performance
-penalty, the default is 0. The C<Dumpxs()> method does not honor this
-flag yet.
+penalty, the default is 0. C<Dump()> will run slower if this flag is set,
+since the fast XSUB implementation doesn't support it yet.
=item $Data::Dumper::Terse I<or> I<$OBJ>->Terse(I<[NEWVAL]>)
@@ -1031,8 +1023,8 @@ to have, you can use the C<Seen> method to pre-seed the internal reference
table and make the dumped output point to them, instead. See L<EXAMPLES>
above.
-The C<Useqq> flag is not honored by C<Dumpxs()> (it always outputs
-strings in single quotes).
+The C<Useqq> flag makes Dump() run slower, since the XSUB implementation
+does not support it.
SCALAR objects have the weirdest looking C<bless> workaround.
diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs
index 6394a63b28..990ea74699 100644
--- a/ext/Data/Dumper/Dumper.xs
+++ b/ext/Data/Dumper/Dumper.xs
@@ -711,23 +711,17 @@ Data_Dumper_Dumpxs(href, ...)
I32 gimme = GIMME;
if (!SvROK(href)) { /* call new to get an object first */
- SV *valarray;
- SV *namearray;
-
- if (items == 3) {
- valarray = ST(1);
- namearray = ST(2);
- }
- else
- croak("Usage: Data::Dumper::Dumpxs(PACKAGE, VAL_ARY_REF, NAME_ARY_REF)");
+ if (items < 2)
+ croak("Usage: Data::Dumper::Dumpxs(PACKAGE, VAL_ARY_REF, [NAME_ARY_REF])");
ENTER;
SAVETMPS;
PUSHMARK(sp);
XPUSHs(href);
- XPUSHs(sv_2mortal(newSVsv(valarray)));
- XPUSHs(sv_2mortal(newSVsv(namearray)));
+ XPUSHs(sv_2mortal(newSVsv(ST(1))));
+ if (items >= 3)
+ XPUSHs(sv_2mortal(newSVsv(ST(2))));
PUTBACK;
i = perl_call_method("new", G_SCALAR);
SPAGAIN;
diff --git a/global.sym b/global.sym
index e34d5c08c7..10b5303d78 100644
--- a/global.sym
+++ b/global.sym
@@ -58,6 +58,7 @@ Perl_croak_nocontext
Perl_die_nocontext
Perl_deb_nocontext
Perl_form_nocontext
+Perl_load_module_nocontext
Perl_mess_nocontext
Perl_warn_nocontext
Perl_warner_nocontext
@@ -195,6 +196,8 @@ Perl_is_utf8_punct
Perl_is_utf8_xdigit
Perl_is_utf8_mark
Perl_leave_scope
+Perl_load_module
+Perl_vload_module
Perl_looks_like_number
Perl_markstack_grow
Perl_mess
diff --git a/hints/hpux.sh b/hints/hpux.sh
index 9a0d362b24..67d823adf6 100644
--- a/hints/hpux.sh
+++ b/hints/hpux.sh
@@ -21,8 +21,10 @@
# Don't assume every OS != 10 is < 10, (e.g., 11).
# From: Chuck Phillips <cdp@fc.hp.com>
# HP-UX 10 pthreads hints: Matthew T Harden <mthard@mthard1.monsanto.com>
+# From: Dominic Dunlop <domo@computer.org>
+# Abort and offer advice if bundled (non-ANSI) C compiler selected
-# This version: August 15, 1997
+# This version: March 8, 2000
# Current maintainer: Jeff Okamoto <okamoto@corp.hp.com>
#--------------------------------------------------------------------
@@ -64,21 +66,19 @@
ccflags="$ccflags -D_HPUX_SOURCE"
# Check if you're using the bundled C compiler. This compiler doesn't support
-# ANSI C (the -Aa flag) nor can it produce shared libraries. Thus we have
-# to turn off dynamic loading.
+# ANSI C (the -Aa flag) and so is not suitable for perl 5.5 and later.
case "$cc" in
'') if cc $ccflags -Aa 2>&1 | $contains 'option' >/dev/null
then
- case "$usedl" in
- '') usedl="$undef"
cat <<'EOM' >&4
-The bundled C compiler can not produce shared libraries, so you will
-not be able to use dynamic loading.
+The bundled C compiler is not ANSI-compliant, and so cannot be used to
+build perl. Please see the file README.hpux for advice on alternative
+compilers.
+Cannot continue, aborting.
EOM
- ;;
- esac
+ exit 1
else
ccflags="$ccflags -Aa" # The add-on compiler supports ANSI C
# cppstdin and cpprun need the -Aa option if you use the unbundled
diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh
index 5a8cbfab8b..65f8158ff0 100644
--- a/hints/solaris_2.sh
+++ b/hints/solaris_2.sh
@@ -479,6 +479,29 @@ case "$uselongdouble" in
;;
esac
+case "$fflushNULL" in
+"$define"|true|[yY]*)
+ # allow them to force it the other way
+ ;;
+*)
+ # All versions of Solaris appear to have a stdio bug that improperly
+ # flushes the input end of pipes. So we avoid the autoflush on
+ # fork/system/exec support for now. :-( See the test case in:
+ # http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-03/msg00373.html
+ # XXX this needs a Configure test so that more such platforms can be
+ # caught automatically.
+ fflushNULL=undef
+ fflushall=undef
+ cat >&4 <<EOM
+
+*** Solaris has a bug that affects input pipes, and so I have disabled
+*** support for automatic flushing on fork/system/exec. If you want
+*** automatic flushing anyway, rerun Configure again with -DfflushNULL.
+
+EOM
+ ;;
+esac
+
rm -f try.c try.o try
# keep that leading tab
ccisworkshop=''
diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp
index 08e7436760..96e1bb44c4 100755
--- a/lib/ExtUtils/xsubpp
+++ b/lib/ExtUtils/xsubpp
@@ -273,7 +273,7 @@ $END = "!End!\n\n"; # "impossible" keyword (multiple newline)
$BLOCK_re= '\s*(' . join('|', qw(
REQUIRE BOOT CASE PREINIT INPUT INIT CODE PPCODE OUTPUT
CLEANUP ALIAS PROTOTYPES PROTOTYPE VERSIONCHECK INCLUDE
- SCOPE INTERFACE INTERFACE_MACRO C_ARGS POST_CALL
+ SCOPE INTERFACE INTERFACE_MACRO C_ARGS POSTCALL
)) . "|$END)\\s*:";
# Input: ($_, @line) == unparsed input.
@@ -436,7 +436,7 @@ sub INPUT_handler {
$func_args =~ s/\b($var_name)\b/&$1/;
}
if ($var_init =~ /^[=;]\s*NO_INIT\s*;?\s*$/
- or $in_out{$var_name} and $in_out{$var_name} eq 'outlist'
+ or $in_out{$var_name} and $in_out{$var_name} eq 'OUTLIST'
and $var_init !~ /\S/) {
if ($name_printed) {
print ";\n";
@@ -522,7 +522,7 @@ EOF
sub CLEANUP_handler() { print_section() }
sub PREINIT_handler() { print_section() }
-sub POST_CALL_handler() { print_section() }
+sub POSTCALL_handler() { print_section() }
sub INIT_handler() { print_section() }
sub GetAliases
@@ -1041,10 +1041,10 @@ while (fetch_para()) {
next unless length $pre;
my $out_type;
my $inout_var;
- if ($process_inout and s/^(in|in_outlist|outlist)\s+//) {
+ if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST)\s+//) {
my $type = $1;
- $out_type = $type if $type ne 'in';
- $arg =~ s/^(in|in_outlist|outlist)\s+//;
+ $out_type = $type if $type ne 'IN';
+ $arg =~ s/^(IN|IN_OUTLIST|OUTLIST)\s+//;
}
if (/\W/) { # Has a type
push @arg_with_types, $arg;
@@ -1052,7 +1052,7 @@ while (fetch_para()) {
$arg_types{$name} = $arg;
$_ = "$name$default";
}
- $out_vars{$_} = 1 if $out_type eq 'outlist';
+ $out_vars{$_} = 1 if $out_type eq 'OUTLIST';
push @in_out, $name if $out_type;
$in_out{$name} = $out_type if $out_type;
}
@@ -1063,10 +1063,10 @@ while (fetch_para()) {
} else {
@args = split(/\s*,\s*/, $orig_args);
for (@args) {
- if ($process_inout and s/^(in|in_outlist|outlist)\s+//) {
+ if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST)\s+//) {
my $out_type = $1;
- next if $out_type eq 'in';
- $out_vars{$_} = 1 if $out_type eq 'outlist';
+ next if $out_type eq 'IN';
+ $out_vars{$_} = 1 if $out_type eq 'OUTLIST';
push @in_out, $name;
$in_out{$_} = $out_type;
}
@@ -1278,7 +1278,7 @@ EOF
# $wantRETVAL set if 'RETVAL =' autogenerated
($wantRETVAL, $ret_type) = (0, 'void') if $RETVAL_no_return;
undef %outargs ;
- process_keyword("POST_CALL|OUTPUT|ALIAS|PROTOTYPE");
+ process_keyword("POSTCALL|OUTPUT|ALIAS|PROTOTYPE");
# all OUTPUT done, so now push the return value on the stack
if ($gotRETVAL && $RETVAL_code) {
diff --git a/lib/bytes.pm b/lib/bytes.pm
index ae7b5fbf5a..f93d6158d9 100644
--- a/lib/bytes.pm
+++ b/lib/bytes.pm
@@ -32,7 +32,7 @@ bytes - Perl pragma to force byte semantics rather than character semantics
=head1 DESCRIPTION
WARNING: The implementation of Unicode support in Perl is incomplete.
-Expect sudden and unannounced changes!
+See L<perlunicode> for the exact details.
The C<use bytes> pragma disables character semantics for the rest of the
lexical scope in which it appears. C<no bytes> can be used to reverse
diff --git a/lib/open.pm b/lib/open.pm
index da8a04453c..8f5c13833b 100644
--- a/lib/open.pm
+++ b/lib/open.pm
@@ -1,4 +1,27 @@
package open;
+$open::hint_bits = 0x20000;
+
+sub import {
+ shift;
+ die "`use open' needs explicit list of disciplines" unless @_;
+ $^H |= $open::hint_bits;
+ while (@_) {
+ my $type = shift;
+ if ($type =~ /^(IN|OUT)\z/s) {
+ my $discp = shift;
+ unless ($discp =~ /^\s*:(raw|crlf)\s*\z/s) {
+ die "Unknown discipline '$discp'";
+ }
+ $^H{"open_$type"} = $discp;
+ }
+ else {
+ die "Unknown discipline class '$type'";
+ }
+ }
+}
+
+1;
+__END__
=head1 NAME
@@ -6,31 +29,48 @@ open - perl pragma to set default disciplines for input and output
=head1 SYNOPSIS
- use open IN => ":any", OUT => ":utf8"; # unimplemented
+ use open IN => ":crlf", OUT => ":raw";
=head1 DESCRIPTION
-NOTE: This pragma is not yet implemented.
-
The open pragma is used to declare one or more default disciplines for
-I/O operations. Any constructors for file, socket, pipe, or directory
-handles found within the lexical scope of this pragma will use the
-declared default.
+I/O operations. Any open() and readpipe() (aka qx//) operators found
+within the lexical scope of this pragma will use the declared defaults.
+Neither open() with an explicit set of disciplines, nor sysopen() are
+not influenced by this pragma.
+
+Only the two pseudo-disciplines ":raw" and ":crlf" are currently
+available.
+
+The ":raw" discipline corresponds to "binary mode" and the ":crlf"
+discipline corresponds to "text mode" on platforms that distinguish
+between the two modes when opening files (which is many DOS-like
+platforms, including Windows). These two disciplines are currently
+no-ops on platforms where binmode() is a no-op, but will be
+supported everywhere in future.
-Handle constructors that are called with an explicit set of disciplines
-are not influenced by the declared defaults.
+=head1 UNIMPLEMENTED FUNCTIONALITY
-The default disciplines so declared are available by the special
-discipline name ":def", and can be used within handle constructors
-that allow disciplines to be specified. This makes it possible to
-stack new disciplines over the default ones.
+Full-fledged support for I/O disciplines is currently unimplemented.
+When they are eventually supported, this pragma will serve as one of
+the interfaces to declare default disciplines for all I/O.
+
+In future, any default disciplines declared by this pragma will be
+available by the special discipline name ":def", and could be used
+within handle constructors that allow disciplines to be specified.
+This would make it possible to stack new disciplines over the default
+ones.
open FH, "<:para :def", $file or die "can't open $file: $!";
+Socket and directory handles will also support disciplines in
+future.
+
+Full support for I/O disciplines will enable all of the supported
+disciplines to work on all platforms.
+
=head1 SEE ALSO
-L<perlunicode>, L<perlfunc/"open">
+L<perlfunc/"binmode">, L<perlfunc/"open">, L<perlunicode>
=cut
-
-1;
diff --git a/lib/perl5db.pl b/lib/perl5db.pl
index de75bd7d86..7c5b0a909c 100644
--- a/lib/perl5db.pl
+++ b/lib/perl5db.pl
@@ -2,7 +2,7 @@ package DB;
# Debugger for Perl 5.00x; perl5db.pl patch level:
-$VERSION = 1.05;
+$VERSION = 1.06;
$header = "perl5db.pl version $VERSION";
# Enhanced by ilya@math.ohio-state.edu (Ilya Zakharevich)
@@ -530,7 +530,7 @@ EOP
}
next CMD; };
$cmd =~ /^t$/ && do {
- ($trace & 1) ? ($trace &= ~1) : ($trace |= 1);
+ $trace ^= 1;
print $OUT "Trace = " .
(($trace & 1) ? "on" : "off" ) . "\n";
next CMD; };
@@ -700,11 +700,14 @@ EOP
}
}
}
+
+ if (not $had_breakpoints{$file} &= ~1) {
+ delete $had_breakpoints{$file};
+ }
}
undef %postponed;
undef %postponed_file;
undef %break_on_load;
- undef %had_breakpoints;
next CMD; };
$cmd =~ /^L$/ && do {
my $file;
@@ -779,7 +782,7 @@ EOP
$break_on_load{$::INC{$file}} = 1 if $::INC{$file};
$file .= '.pm', redo unless $file =~ /\./;
}
- $had_breakpoints{$file} = 1;
+ $had_breakpoints{$file} |= 1;
print $OUT "Will stop on load of `@{[join '\', `', sort keys %break_on_load]}'.\n";
next CMD; };
$cmd =~ /^b\b\s*(postpone|compile)\b\s*([':A-Za-z_][':\w]*)\s*(.*)/ && do {
@@ -805,7 +808,7 @@ EOP
if ($i) {
local $filename = $file;
local *dbline = $main::{'_<' . $filename};
- $had_breakpoints{$filename} = 1;
+ $had_breakpoints{$filename} |= 1;
$max = $#dbline;
++$i while $dbline[$i] == 0 && $i < $max;
$dbline{$i} =~ s/^[^\0]*/$cond/;
@@ -814,21 +817,22 @@ EOP
}
next CMD; };
$cmd =~ /^b\b\s*(\d*)\s*(.*)/ && do {
- $i = ($1?$1:$line);
+ $i = $1 || $line;
$cond = $2 || '1';
if ($dbline[$i] == 0) {
print $OUT "Line $i not breakable.\n";
} else {
- $had_breakpoints{$filename} = 1;
+ $had_breakpoints{$filename} |= 1;
$dbline{$i} =~ s/^[^\0]*/$cond/;
}
next CMD; };
- $cmd =~ /^d\b\s*(\d+)?/ && do {
- $i = ($1?$1:$line);
+ $cmd =~ /^d\b\s*(\d*)/ && do {
+ $i = $1 || $line;
$dbline{$i} =~ s/^[^\0]*//;
delete $dbline{$i} if $dbline{$i} eq '';
next CMD; };
$cmd =~ /^A$/ && do {
+ print $OUT "Deleting all actions...\n";
my $file;
for $file (keys %had_breakpoints) {
local *dbline = $main::{'_<' . $file};
@@ -841,6 +845,10 @@ EOP
delete $dbline{$i} if $dbline{$i} eq '';
}
}
+
+ if (not $had_breakpoints{$file} &= ~2) {
+ delete $had_breakpoints{$file};
+ }
}
next CMD; };
$cmd =~ /^O\s*$/ && do {
@@ -872,13 +880,19 @@ EOP
$pretype = [], next CMD unless $1;
$pretype = [$1];
next CMD; };
- $cmd =~ /^a\b\s*(\d+)(\s+(.*))?/ && do {
- $i = $1; $j = $3;
- if ($dbline[$i] == 0) {
- print $OUT "Line $i may not have an action.\n";
+ $cmd =~ /^a\b\s*(\d*)\s*(.*)/ && do {
+ $i = $1 || $line; $j = $2;
+ if (length $j) {
+ if ($dbline[$i] == 0) {
+ print $OUT "Line $i may not have an action.\n";
+ } else {
+ $had_breakpoints{$filename} |= 2;
+ $dbline{$i} =~ s/\0[^\0]*//;
+ $dbline{$i} .= "\0" . action($j);
+ }
} else {
$dbline{$i} =~ s/\0[^\0]*//;
- $dbline{$i} .= "\0" . action($j);
+ delete $dbline{$i} if $dbline{$i} eq '';
}
next CMD; };
$cmd =~ /^n$/ && do {
@@ -906,7 +920,7 @@ EOP
if ($i) {
$filename = $file;
*dbline = $main::{'_<' . $filename};
- $had_breakpoints{$filename}++;
+ $had_breakpoints{$filename} |= 1;
$max = $#dbline;
++$i while $dbline[$i] == 0 && $i < $max;
} else {
@@ -1086,7 +1100,7 @@ EOP
next CMD; };
$cmd =~ /^$rc+\s*(-)?(\d+)?$/ && do {
pop(@hist) if length($cmd) > 1;
- $i = $1 ? ($#hist-($2?$2:1)) : ($2?$2:$#hist);
+ $i = $1 ? ($#hist-($2||1)) : ($2||$#hist);
$cmd = $hist[$i];
print $OUT $cmd, "\n";
redo CMD; };
@@ -1301,7 +1315,7 @@ sub postponed_sub {
$i += $offset;
local *dbline = $main::{'_<' . $file};
local $^W = 0; # != 0 is magical below
- $had_breakpoints{$file}++;
+ $had_breakpoints{$file} |= 1;
my $max = $#dbline;
++$i until $dbline[$i] != 0 or $i >= $max;
$dbline{$i} = delete $postponed{$subname};
@@ -1329,7 +1343,7 @@ sub postponed {
if $break_on_load{$filename};
print $LINEINFO ' ' x $stack_depth, "Package $filename.\n" if $frame;
return unless $postponed_file{$filename};
- $had_breakpoints{$filename}++;
+ $had_breakpoints{$filename} |= 1;
#%dbline = %{$postponed_file{$filename}}; # Cannot be done: unsufficient magic
my $key;
for $key (keys %{$postponed_file{$filename}}) {
@@ -1821,7 +1835,7 @@ B<l> I<min>B<+>I<incr> List I<incr>+1 lines starting at I<min>.
B<l> I<min>B<->I<max> List lines I<min> through I<max>.
B<l> I<line> List single I<line>.
B<l> I<subname> List first window of lines from subroutine.
-B<l> I<$var> List first window of lines from subroutine referenced by I<$var>.
+B<l> I<\$var> List first window of lines from subroutine referenced by I<\$var>.
B<l> List next window of lines.
B<-> List previous window of lines.
B<w> [I<line>] List window around I<line>.
@@ -1844,7 +1858,7 @@ B<b> [I<line>] [I<condition>]
I<condition> breaks if it evaluates to true, defaults to '1'.
B<b> I<subname> [I<condition>]
Set breakpoint at first line of subroutine.
-B<b> I<$var> Set breakpoint at first line of subroutine referenced by I<$var>.
+B<b> I<\$var> Set breakpoint at first line of subroutine referenced by I<\$var>.
B<b> B<load> I<filename> Set breakpoint on `require'ing the given file.
B<b> B<postpone> I<subname> [I<condition>]
Set breakpoint at first line of subroutine after
@@ -1854,10 +1868,12 @@ B<b> B<compile> I<subname>
B<d> [I<line>] Delete the breakpoint for I<line>.
B<D> Delete all breakpoints.
B<a> [I<line>] I<command>
- Set an action to be done before the I<line> is executed.
+ Set an action to be done before the I<line> is executed;
+ I<line> defaults to the current execution line.
Sequence is: check for breakpoint/watchpoint, print line
if necessary, do action, prompt user if necessary,
- execute expression.
+ execute line.
+B<a> [I<line>] Delete the action for I<line>.
B<A> Delete all actions.
B<W> I<expr> Add a global watch-expression.
B<W> Delete all watch-expressions.
@@ -1877,14 +1893,14 @@ B<O> [I<opt>[B<=>I<val>]] [I<opt>B<\">I<val>B<\">] [I<opt>B<?>]...
I<signalLevel> I<warnLevel> I<dieLevel>: level of verbosity;
I<inhibit_exit> Allows stepping off the end of the script.
I<ImmediateStop> Debugger should stop as early as possible.
- I<RemotePort>: Remote hostname:port for remote debugging
+ I<RemotePort>: Remote hostname:port for remote debugging
The following options affect what happens with B<V>, B<X>, and B<x> commands:
I<arrayDepth>, I<hashDepth>: print only first N elements ('' for all);
I<compactDump>, I<veryCompact>: change style of array and hash dump;
I<globPrint>: whether to print contents of globs;
I<DumpDBFiles>: dump arrays holding debugged files;
I<DumpPackages>: dump symbol tables of packages;
- I<DumpReused>: dump contents of \"reused\" addresses;
+ I<DumpReused>: dump contents of \"reused\" addresses;
I<quote>, I<HighBit>, I<undefPrint>: change style of string dump;
I<bareStringify>: Do not print the overload-stringified value;
Option I<PrintRet> affects printing of return value after B<r> command,
@@ -1899,7 +1915,7 @@ B<O> [I<opt>[B<=>I<val>]] [I<opt>B<\">I<val>B<\">] [I<opt>B<?>]...
B<<> I<expr> Define Perl command to run before each prompt.
B<<<> I<expr> Add to the list of Perl commands to run before each prompt.
B<>> I<expr> Define Perl command to run after each prompt.
-B<>>B<>> I<expr> Add to the list of Perl commands to run after each prompt.
+B<>>B<>> I<expr> Add to the list of Perl commands to run after each prompt.
B<{> I<db_command> Define debugger command to run before each prompt.
B<{{> I<db_command> Add to the list of debugger commands to run before each prompt.
B<$prc> I<number> Redo a previous command (default previous command).
diff --git a/lib/utf8.pm b/lib/utf8.pm
index c362a1c516..17ec37bbe2 100644
--- a/lib/utf8.pm
+++ b/lib/utf8.pm
@@ -31,7 +31,7 @@ utf8 - Perl pragma to enable/disable UTF-8 in source code
=head1 DESCRIPTION
WARNING: The implementation of Unicode support in Perl is incomplete.
-Expect sudden and unannounced changes!
+See L<perlunicode> for the exact details.
The C<use utf8> pragma tells the Perl parser to allow UTF-8 in the
program text in the current lexical scope. The C<no utf8> pragma
diff --git a/mpeix/mpeixish.h b/mpeix/mpeixish.h
index b5e4fa4455..562462106b 100644
--- a/mpeix/mpeixish.h
+++ b/mpeix/mpeixish.h
@@ -34,7 +34,7 @@
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
diff --git a/objXSUB.h b/objXSUB.h
index bc17e877b2..569065ca69 100644
--- a/objXSUB.h
+++ b/objXSUB.h
@@ -188,6 +188,10 @@
#define Perl_form_nocontext pPerl->Perl_form_nocontext
#undef form_nocontext
#define form_nocontext Perl_form_nocontext
+#undef Perl_load_module_nocontext
+#define Perl_load_module_nocontext pPerl->Perl_load_module_nocontext
+#undef load_module_nocontext
+#define load_module_nocontext Perl_load_module_nocontext
#undef Perl_mess_nocontext
#define Perl_mess_nocontext pPerl->Perl_mess_nocontext
#undef mess_nocontext
@@ -747,6 +751,14 @@
#define Perl_leave_scope pPerl->Perl_leave_scope
#undef leave_scope
#define leave_scope Perl_leave_scope
+#undef Perl_load_module
+#define Perl_load_module pPerl->Perl_load_module
+#undef load_module
+#define load_module Perl_load_module
+#undef Perl_vload_module
+#define Perl_vload_module pPerl->Perl_vload_module
+#undef vload_module
+#define vload_module Perl_vload_module
#undef Perl_looks_like_number
#define Perl_looks_like_number pPerl->Perl_looks_like_number
#undef looks_like_number
diff --git a/op.c b/op.c
index d6a16db0aa..cb25f23749 100644
--- a/op.c
+++ b/op.c
@@ -356,8 +356,9 @@ S_pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv,
if (CxREALEVAL(cx))
saweval = i;
break;
+ case OP_DOFILE:
case OP_REQUIRE:
- /* require must have its own scope */
+ /* require/do must have their own scope */
return 0;
}
break;
@@ -1821,7 +1822,6 @@ S_dup_attrlist(pTHX_ OP *o)
STATIC void
S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs)
{
- OP *modname; /* for 'use' */
SV *stashsv;
/* fake up C<use attributes $pkg,$rv,@attrs> */
@@ -1831,19 +1831,18 @@ S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs)
stashsv = newSVpv(HvNAME(stash), 0);
else
stashsv = &PL_sv_no;
+
#define ATTRSMODULE "attributes"
- modname = newSVOP(OP_CONST, 0,
- newSVpvn(ATTRSMODULE, sizeof(ATTRSMODULE)-1));
- modname->op_private |= OPpCONST_BARE;
- /* that flag is required to make 'use' work right */
- utilize(1, start_subparse(FALSE, 0),
- Nullop, /* version */
- modname,
- prepend_elem(OP_LIST,
- newSVOP(OP_CONST, 0, stashsv),
- prepend_elem(OP_LIST,
- newSVOP(OP_CONST, 0, newRV(target)),
- dup_attrlist(attrs))));
+
+ Perl_load_module(aTHX_ PERL_LOADMOD_IMPORT_OPS,
+ newSVpvn(ATTRSMODULE, sizeof(ATTRSMODULE)-1),
+ Nullsv,
+ prepend_elem(OP_LIST,
+ newSVOP(OP_CONST, 0, stashsv),
+ prepend_elem(OP_LIST,
+ newSVOP(OP_CONST, 0,
+ newRV(target)),
+ dup_attrlist(attrs))));
LEAVE;
}
@@ -3175,6 +3174,58 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *id, OP *arg)
PL_expect = XSTATE;
}
+void
+Perl_load_module(pTHX_ U32 flags, SV *name, SV *ver, ...)
+{
+ va_list args;
+ va_start(args, ver);
+ vload_module(flags, name, ver, &args);
+ va_end(args);
+}
+
+#ifdef PERL_IMPLICIT_CONTEXT
+void
+Perl_load_module_nocontext(U32 flags, SV *name, SV *ver, ...)
+{
+ dTHX;
+ va_list args;
+ va_start(args, ver);
+ vload_module(flags, name, ver, &args);
+ va_end(args);
+}
+#endif
+
+void
+Perl_vload_module(pTHX_ U32 flags, SV *name, SV *ver, va_list *args)
+{
+ OP *modname, *veop, *imop;
+
+ modname = newSVOP(OP_CONST, 0, name);
+ modname->op_private |= OPpCONST_BARE;
+ if (ver) {
+ veop = newSVOP(OP_CONST, 0, ver);
+ }
+ else
+ veop = Nullop;
+ if (flags & PERL_LOADMOD_NOIMPORT) {
+ imop = sawparens(newNULLLIST());
+ }
+ else if (flags & PERL_LOADMOD_IMPORT_OPS) {
+ imop = va_arg(*args, OP*);
+ }
+ else {
+ SV *sv;
+ imop = Nullop;
+ sv = va_arg(*args, SV*);
+ while (sv) {
+ imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
+ sv = va_arg(*args, SV*);
+ }
+ }
+ utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
+ veop, modname, imop);
+}
+
OP *
Perl_dofile(pTHX_ OP *term)
{
@@ -5510,11 +5561,10 @@ Perl_ck_glob(pTHX_ OP *o)
#if !defined(PERL_EXTERNAL_GLOB)
/* XXX this can be tightened up and made more failsafe. */
if (!gv) {
- OP *modname = newSVOP(OP_CONST, 0, newSVpvn("File::Glob", 10));
- modname->op_private |= OPpCONST_BARE;
ENTER;
- utilize(1, start_subparse(FALSE, 0), Nullop, modname,
- newSVOP(OP_CONST, 0, newSVpvn(":globally", 9)));
+ Perl_load_module(aTHX_ 0, newSVpvn("File::Glob", 10), Nullsv,
+ /* null-terminated import list */
+ newSVpvn(":globally", 9), Nullsv);
gv = gv_fetchpv("CORE::GLOBAL::glob", FALSE, SVt_PVCV);
LEAVE;
}
@@ -5786,6 +5836,36 @@ Perl_ck_null(pTHX_ OP *o)
}
OP *
+Perl_ck_open(pTHX_ OP *o)
+{
+ HV *table = GvHV(PL_hintgv);
+ if (table) {
+ SV **svp;
+ I32 mode;
+ svp = hv_fetch(table, "open_IN", 7, FALSE);
+ if (svp && *svp) {
+ mode = mode_from_discipline(*svp);
+ if (mode & O_BINARY)
+ o->op_private |= OPpOPEN_IN_RAW;
+ else if (mode & O_TEXT)
+ o->op_private |= OPpOPEN_IN_CRLF;
+ }
+
+ svp = hv_fetch(table, "open_OUT", 8, FALSE);
+ if (svp && *svp) {
+ mode = mode_from_discipline(*svp);
+ if (mode & O_BINARY)
+ o->op_private |= OPpOPEN_OUT_RAW;
+ else if (mode & O_TEXT)
+ o->op_private |= OPpOPEN_OUT_CRLF;
+ }
+ }
+ if (o->op_type == OP_BACKTICK)
+ return o;
+ return ck_fun(o);
+}
+
+OP *
Perl_ck_repeat(pTHX_ OP *o)
{
if (cBINOPo->op_first->op_flags & OPf_PARENS) {
@@ -5812,7 +5892,13 @@ Perl_ck_require(pTHX_ OP *o)
--SvCUR(kid->op_sv);
}
}
- sv_catpvn(kid->op_sv, ".pm", 3);
+ if (SvREADONLY(kid->op_sv)) {
+ SvREADONLY_off(kid->op_sv);
+ sv_catpvn(kid->op_sv, ".pm", 3);
+ SvREADONLY_on(kid->op_sv);
+ }
+ else
+ sv_catpvn(kid->op_sv, ".pm", 3);
}
}
return ck_fun(o);
diff --git a/op.h b/op.h
index da03aa46db..827b0803aa 100644
--- a/op.h
+++ b/op.h
@@ -197,6 +197,12 @@ Deprecated. Use C<GIMME_V> instead.
/* Private for OP_THREADSV */
#define OPpDONE_SVREF 64 /* Been through newSVREF once */
+/* Private for OP_OPEN and OP_BACKTICK */
+#define OPpOPEN_IN_RAW 16 /* binmode(F,":raw") on input fh */
+#define OPpOPEN_IN_CRLF 32 /* binmode(F,":crlf") on input fh */
+#define OPpOPEN_OUT_RAW 64 /* binmode(F,":raw") on output fh */
+#define OPpOPEN_OUT_CRLF 128 /* binmode(F,":crlf") on output fh */
+
struct op {
BASEOP
};
@@ -418,3 +424,8 @@ struct loop {
# define OpREFCNT_inc(o) (o)
# define OpREFCNT_dec(o) 0
#endif
+
+/* flags used by Perl_load_module() */
+#define PERL_LOADMOD_DENY 0x1
+#define PERL_LOADMOD_NOIMPORT 0x2
+#define PERL_LOADMOD_IMPORT_OPS 0x4
diff --git a/opcode.h b/opcode.h
index 646add4f75..7ff516b5aa 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1118,7 +1118,7 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = {
MEMBER_TO_FPTR(Perl_ck_null), /* srefgen */
MEMBER_TO_FPTR(Perl_ck_fun), /* ref */
MEMBER_TO_FPTR(Perl_ck_fun), /* bless */
- MEMBER_TO_FPTR(Perl_ck_null), /* backtick */
+ MEMBER_TO_FPTR(Perl_ck_open), /* backtick */
MEMBER_TO_FPTR(Perl_ck_glob), /* glob */
MEMBER_TO_FPTR(Perl_ck_null), /* readline */
MEMBER_TO_FPTR(Perl_ck_null), /* rcatline */
@@ -1285,7 +1285,7 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = {
MEMBER_TO_FPTR(Perl_ck_null), /* dump */
MEMBER_TO_FPTR(Perl_ck_null), /* goto */
MEMBER_TO_FPTR(Perl_ck_fun), /* exit */
- MEMBER_TO_FPTR(Perl_ck_fun), /* open */
+ MEMBER_TO_FPTR(Perl_ck_open), /* open */
MEMBER_TO_FPTR(Perl_ck_fun), /* close */
MEMBER_TO_FPTR(Perl_ck_fun), /* pipe_op */
MEMBER_TO_FPTR(Perl_ck_fun), /* fileno */
diff --git a/opcode.pl b/opcode.pl
index 29ef602741..fc661caaf4 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -377,7 +377,7 @@ bless bless ck_fun s@ S S?
# Pushy I/O.
-backtick quoted execution (``, qx) ck_null t%
+backtick quoted execution (``, qx) ck_open t%
# glob defaults its first arg to $_
glob glob ck_glob t@ S?
readline <HANDLE> ck_null t%
@@ -605,7 +605,7 @@ exit exit ck_fun ds% S?
# I/O.
-open open ck_fun ist@ F S? L
+open open ck_open ist@ F S? L
close close ck_fun is% F?
pipe_op pipe ck_fun is@ F F
diff --git a/os2/os2ish.h b/os2/os2ish.h
index 8b7613eb32..76d1b8c4f3 100644
--- a/os2/os2ish.h
+++ b/os2/os2ish.h
@@ -19,7 +19,7 @@
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
diff --git a/perl.h b/perl.h
index d9dcbba26f..911b998a94 100644
--- a/perl.h
+++ b/perl.h
@@ -1778,13 +1778,13 @@ typedef pthread_key_t perl_key;
#if defined(__CYGWIN__)
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
# define USEMYBINMODE / **/
-# define my_binmode(fp, iotype) \
- (PerlLIO_setmode(PerlIO_fileno(fp), O_BINARY) != -1 ? TRUE : FALSE)
+# define my_binmode(fp, iotype, mode) \
+ (PerlLIO_setmode(PerlIO_fileno(fp), mode) != -1 ? TRUE : FALSE)
#endif
#ifdef UNION_ANY_DEFINITION
@@ -3225,6 +3225,14 @@ typedef struct am_table_short AMTS;
# define O_CREAT 0100
#endif
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+#ifndef O_TEXT
+# define O_TEXT 0
+#endif
+
#ifdef IAMSUID
#ifdef I_SYS_STATVFS
diff --git a/perlapi.c b/perlapi.c
index 1d619ef81e..cfb4dc8b84 100755
--- a/perlapi.c
+++ b/perlapi.c
@@ -371,6 +371,17 @@ Perl_form_nocontext(const char* pat, ...)
}
+#undef Perl_load_module_nocontext
+void
+Perl_load_module_nocontext(U32 flags, SV* name, SV* ver, ...)
+{
+ dTHXo;
+ va_list args;
+ va_start(args, ver);
+ ((CPerlObj*)pPerl)->Perl_vload_module(flags, name, ver, &args);
+ va_end(args);
+}
+
#undef Perl_mess_nocontext
SV*
Perl_mess_nocontext(const char* pat, ...)
@@ -1389,6 +1400,23 @@ Perl_leave_scope(pTHXo_ I32 base)
((CPerlObj*)pPerl)->Perl_leave_scope(base);
}
+#undef Perl_load_module
+void
+Perl_load_module(pTHXo_ U32 flags, SV* name, SV* ver, ...)
+{
+ va_list args;
+ va_start(args, ver);
+ ((CPerlObj*)pPerl)->Perl_vload_module(flags, name, ver, &args);
+ va_end(args);
+}
+
+#undef Perl_vload_module
+void
+Perl_vload_module(pTHXo_ U32 flags, SV* name, SV* ver, va_list* args)
+{
+ ((CPerlObj*)pPerl)->Perl_vload_module(flags, name, ver, args);
+}
+
#undef Perl_looks_like_number
I32
Perl_looks_like_number(pTHXo_ SV* sv)
diff --git a/plan9/plan9ish.h b/plan9/plan9ish.h
index bac6a92d8f..6fb59663f3 100644
--- a/plan9/plan9ish.h
+++ b/plan9/plan9ish.h
@@ -54,7 +54,7 @@
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
diff --git a/pod/perldebug.pod b/pod/perldebug.pod
index 4afb855955..fe2418457e 100644
--- a/pod/perldebug.pod
+++ b/pod/perldebug.pod
@@ -286,7 +286,8 @@ Delete all installed breakpoints.
=item a [line] command
-Set an action to be done before the line is executed.
+Set an action to be done before the line is executed. If line is
+omitted, sets an action on the line that is about to be executed.
The sequence of steps taken by the debugger is
1. check for a breakpoint at this line
@@ -300,6 +301,11 @@ For example, this will print out $foo every time line
a 53 print "DB FOUND $foo\n"
+=item a [line]
+
+Delete an action at the specified line. If line is omitted, deletes
+the action on the line that is about to be executed.
+
=item A
Delete all installed actions.
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 8fc8efe2b7..a7a2279191 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -4,12 +4,6 @@ perldelta - what's new for perl v5.6.0
=head1 DESCRIPTION
-This is an unsupported alpha release, meant for intrepid Perl
-developers only. The included sources may not even build correctly on
-some platforms. Subscribing to perl5-porters is the best way to
-monitor and contribute to the progress of development releases (see
-http://www.hut.fi/~jhi/perl5-porters.html for info).
-
This document describes differences between the 5.005 release and this one.
=head1 Incompatible Changes
@@ -138,7 +132,7 @@ Perl 5.004 deprecated the interpretation of C<$$1> and
similar within interpolated strings to mean C<$$ . "1">,
but still allowed it.
-In Perl 5.6 and later, C<"$$1"> always means C<"${$1}">.
+In Perl 5.6.0 and later, C<"$$1"> always means C<"${$1}">.
=item delete(), values() and C<\(%h)> operate on aliases to values, not copies
@@ -419,15 +413,18 @@ See INSTALL for complete details.
=head2 Unicode and UTF-8 support
-Perl can optionally use UTF-8 as its internal representation for character
+WARNING: This is an experimental feature. Implementation details are
+subject to change.
+
+Perl now uses UTF-8 as its internal representation for character
strings. The C<utf8> and C<bytes> pragmas are used to control this support
in the current lexical scope. See L<perlunicode>, L<utf8> and L<bytes> for
more information.
=head2 Interpreter cloning, threads, and concurrency
-WARNING: This is an experimental feature in a pre-alpha state. Use
-at your own risk.
+WARNING: This is an experimental feature. Implementation details are
+subject to change.
Perl 5.005_63 introduces the beginnings of support for running multiple
interpreters concurrently in different threads. In conjunction with
@@ -475,11 +472,10 @@ for details.
=head2 Lvalue subroutines
-WARNING: This is an experimental feature.
+WARNING: This is an experimental feature. Details are subject to change.
-change#4081
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>,
-Tuomas Lukka <lukka@iki.fi>)]
+Subroutines can now return modifiable lvalues.
+See L<perlsub/"Lvalue subroutines">.
=head2 "our" declarations
@@ -558,9 +554,6 @@ automatically undef-ed.
To use this feature, you need the WeakRef package from CPAN, which
contains additional documentation.
-change#3385, also need perlguts documentation
-[TODO - Tuomas Lukka <lukka@iki.fi>]
-
=head2 File globbing implemented internally
WARNING: This is currently an experimental feature. Interfaces and
@@ -874,24 +867,18 @@ the C<:> is optional.)
F<AutoSplit.pm> and F<SelfLoader.pm> have been updated to keep the attributes
with the stubs they provide. See L<attributes>.
-=head2 Regular expression improvements
-
-change#2827,2373,2372,2365,1813,1800,4112,4158,4215,4301
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
-=head2 Overloading improvements
-
-change#2150
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
=head2 open() with more than two arguments
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+If open() is passed three arguments instead of two, the second arguments
+is used as the mode and the third argument is taken to be the file name.
+This is primarily useful for protecting against unintended magic behavior
+of the traditional two-argument form. See L<perlfunc/open>.
=head2 Support for interpolating named characters
-change#4052
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+The new C<\N> escape interpolates named characters within strings.
+For example, C<"Hi! \N{WHITE SMILING FACE}"> evaluates to a string
+with a unicode smiley face at the end.
=head2 C<require> and C<do> may be overridden
@@ -986,6 +973,9 @@ was attempted. This mostly eliminates confusing
buffering mishaps suffered by users unaware of how Perl internally
handles I/O.
+This is not supported on some platforms like Solaris where a suitably
+correct implementation of fflush(NULL) isn't available.
+
=head2 Better diagnostics on meaningless filehandle operations
Constructs such as C<< open(<FH>) >> and C<< close(<FH>) >>
@@ -1105,11 +1095,6 @@ subroutine was not found in the package. Such cases stopped
later method lookups from progressing into base packages.
This has been corrected.
-=head2 Consistent numeric conversions
-
-change#3378,3318
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
=head2 Taint failures under C<-U>
When running in unsafe mode, taint violations could sometimes
@@ -1170,16 +1155,6 @@ Certain operations in the RHS of assignment statements have been
optimized to directly set the lexical variable on the LHS,
eliminating redundant copying overheads.
-=head2 Faster mechanism to invoke XSUBs
-
-change#4044,4125
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
-=head2 Perl_malloc() improvements
-
-change#4237
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
=head2 Faster subroutine calls
Minor changes in how subroutine calls are handled internally
@@ -1240,10 +1215,6 @@ This port is still using its own builtin globbing.
=back
-=head2 OS/2
-
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
=head2 OS390 (OpenEdition MVS)
Support for this EBCDIC platform has not been renewed in this release.
@@ -1283,8 +1254,8 @@ patches, testing, and ideas.
=head2 Win32
-Site library searches failed to look for ".../site/5.XXX/lib"
-if ".../site/5.XXXYY/lib" wasn't found. This has been corrected.
+Perl can now emulate fork() with multiple interpreters. This support
+must be enabled at build time. See L<perlfork> for detailed information.
When given a pathname that consists only of a drivename, such
as C<A:>, opendir() and stat() now use the current working
@@ -1327,8 +1298,6 @@ preserve compatibility with the older syntax, you might want to put
a C<use File::DosGlob;> in your program. For details and compatibility
information, see L<File::Glob>.
-[TODO - GSAR]
-
=head1 New tests
=over 4
@@ -1427,14 +1396,16 @@ See L<constant>.
=item charnames
-change#4052
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
+This pragma implements the C<\N> string escape. See L<charnames>.
=item Data::Dumper
A C<Maxdepth> setting can be specified to avoid venturing
too deeply into deep data structures. See L<Data::Dumper>.
+The XSUB implementation of Dump() is now automatically called if the
+C<Useqq> setting is not in use.
+
Dumping C<qr//> objects works correctly.
=item DB
@@ -1511,11 +1482,6 @@ $PERL_VERSION now stands for C<$^V> (a string value) rather than for C<$]>
Env now supports accessing environment variables like PATH as array
variables.
-=item ExtUtils::MakeMaker
-
-change#4135, also needs docs in module pod
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
=item Fcntl
More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for
@@ -1711,7 +1677,7 @@ Pod::InputObjects defines some input objects needed by Pod::Parser, and
for advanced users of Pod::Parser that need more about a command besides
its name and text.
-As of release 5.6 of Perl, Pod::Parser is now the officially sanctioned
+As of release 5.6.0 of Perl, Pod::Parser is now the officially sanctioned
"base parser code" recommended for use by all pod2xxx translators.
Pod::Text (pod2text) and Pod::Man (pod2man) have already been converted
to use Pod::Parser and efforts to convert Pod::HTML (pod2html) are already
@@ -1853,8 +1819,6 @@ C<use attrs> is now obsolete, and is only provided for
backward-compatibility. It's been replaced by the C<sub : attributes>
syntax. See L<perlsub/"Subroutine Attributes"> and L<attributes>.
-C<use utf8> to enable UTF-8 and Unicode support.
-
Lexical warnings pragma, C<use warnings;>, to control optional warnings.
See L<perllexwarn>.
@@ -1867,10 +1831,6 @@ but access(2) knows better.
=head1 Utility Changes
-=head2 h2ph
-
-[TODO - Kurt Starsinic <kstar@chapin.edu>]
-
=head2 perlcc
C<perlcc> now supports the C and Bytecode backends. By default,
@@ -1879,11 +1839,6 @@ optimized C backend.
Support for non-Unix platforms has been improved.
-=head2 h2xs
-
-change#4232
-[TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
-
=head1 Documentation Changes
=over 4
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 650a00a842..2f342900a1 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -443,21 +443,28 @@ L<perlipc/"Sockets: Client/Server Communication">.
=item binmode FILEHANDLE
-Arranges for FILEHANDLE to be read or written in "binary" mode on
-systems where the run-time libraries distinguish between binary and
+Arranges for FILEHANDLE to be read or written in "binary" or "text" mode
+on systems where the run-time libraries distinguish between binary and
text files. If FILEHANDLE is an expression, the value is taken as the
-name of the filehandle. binmode() should be called after open() but
-before any I/O is done on the filehandle. The only way to reset
-binary mode on a filehandle is to reopen the file.
+name of the filehandle. DISCIPLINE can be either of C<":raw"> for
+binary mode or C<":crlf"> for "text" mode. If the DISCIPLINE is
+omitted, it defaults to C<":raw">.
-On many systems binmode() has no effect, and on some systems it is
-necessary when you're not working with a text file. For the sake of
-portability it is a good idea to always use it when appropriate, and
-to never use it when it isn't appropriate.
+binmode() should be called after open() but before any I/O is done on
+the filehandle.
+
+On many systems binmode() currently has no effect, but in future, it
+will be extended to support user-defined input and output disciplines.
+On some systems binmode() is necessary when you're not working with a
+text file. For the sake of portability it is a good idea to always use
+it when appropriate, and to never use it when it isn't appropriate.
In other words: Regardless of platform, use binmode() on binary
files, and do not use binmode() on text files.
+The C<open> pragma can be used to establish default disciplines.
+See L<open>.
+
The operating system, device drivers, C libraries, and Perl run-time
system all work together to let the programmer treat a single
character (C<\n>) as the line terminator, irrespective of the external
diff --git a/pod/perlhist.pod b/pod/perlhist.pod
index 4d9858e5ee..17a13a2fd3 100644
--- a/pod/perlhist.pod
+++ b/pod/perlhist.pod
@@ -336,6 +336,7 @@ the strings?).
5.5.650 2000-Feb-08 5.6 beta1
5.5.660 2000-Feb-22 5.6 beta2
5.5.670 2000-Feb-29 5.6 beta3
+ 5.6.0-RC1 2000-Mar-09 5.6 release candidate 1
=head2 SELECTED RELEASE SIZES
diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod
index c5ffbaf0e4..c8e31bf66c 100644
--- a/pod/perlunicode.pod
+++ b/pod/perlunicode.pod
@@ -4,14 +4,48 @@ perlunicode - Unicode support in Perl
=head1 DESCRIPTION
+=head2 Important Caveat
+
WARNING: The implementation of Unicode support in Perl is incomplete.
-Expect sudden and unannounced changes!
+
+The following areas need further work.
+
+=over
+
+=item Input and Output Disciplines
+
+There is currently no easy way to mark data read from a file or other
+external source as being utf8. This will be one of the major areas of
+focus in the near future.
+
+=item Regular Expressions
+
+The existing regular expression compiler does not produce polymorphic
+opcodes. This means that the determination on whether to match Unicode
+characters is made when the pattern is compiled, based on whether the
+pattern contains Unicode characters, and not when the matching happens
+at run time. This needs to be changed to adaptively match Unicode if
+the string to be matched is Unicode.
+
+=item C<use utf8> still needed to enable a few features
+
+The C<utf8> pragma implements the tables used for Unicode support. These
+tables are automatically loaded on demand, so the C<utf8> pragma need not
+normally be used.
+
+However, as a compatibility measure, this pragma must be explicitly used
+to enable recognition of UTF-8 encoded literals and identifiers in the
+source text.
+
+=back
+
+=head2 Byte and Character semantics
Beginning with version 5.6, Perl uses logically wide characters to
represent strings internally. This internal representation of strings
uses the UTF-8 encoding.
-In future, Perl-level operations will expect to work with characters
+In future, Perl-level operations can be expected to work with characters
rather than bytes, in general.
However, as strictly an interim compatibility measure, Perl v5.6 aims to
@@ -27,9 +61,7 @@ which allowed byte semantics in Perl operations, but only as long as
none of the program's inputs are marked as being as source of Unicode
character data. Such data may come from filehandles, from calls to
external programs, from information provided by the system (such as %ENV),
-or from literals and constants in the source text. Later, in
-L</Character encodings for input and output>, we'll see how such
-inputs may be marked as being Unicode character data sources.
+or from literals and constants in the source text.
If the C<-C> command line switch is used, (or the ${^WIDE_SYSTEM_CALLS}
global flag is set to C<1>), all system calls will use the
@@ -40,8 +72,8 @@ Regardless of the above, the C<bytes> pragma can always be used to force
byte semantics in a particular lexical scope. See L<bytes>.
The C<utf8> pragma is primarily a compatibility device that enables
-recognition of UTF-8 in literals encountered by the parser. It is also
-used for enabling some of the more experimental Unicode support features.
+recognition of UTF-8 in literals encountered by the parser. It may also
+be used for enabling some of the more experimental Unicode support features.
Note that this pragma is only required until a future version of Perl
in which character semantics will become the default. This pragma may
then become a no-op. See L<utf8>.
@@ -58,7 +90,7 @@ on Unicode data, the C<bytes> pragma should be used.
Under character semantics, many operations that formerly operated on
bytes change to operating on characters. For ASCII data this makes
no difference, because UTF-8 stores ASCII in single bytes, but for
-any character greater than C<chr(127)>, the character is stored in
+any character greater than C<chr(127)>, the character may be stored in
a sequence of two or more bytes, all of which have the high bit set.
But by and large, the user need not worry about this, because Perl
hides it from the user. A character in Perl is logically just a number
@@ -75,9 +107,7 @@ Character semantics have the following effects:
=item *
Strings and patterns may contain characters that have an ordinal value
-larger than 255. In Perl v5.6, this is only enabled if the lexical
-scope has a C<use utf8> declaration (due to compatibility needs) but
-future versions may enable this by default.
+larger than 255.
Presuming you use a Unicode editor to edit your program, such characters
will typically occur directly within the literal strings as UTF-8
@@ -98,10 +128,6 @@ characters, including ideographs. (You are currently on your own when
it comes to using the canonical forms of characters--Perl doesn't (yet)
attempt to canonicalize variable names for you.)
-This also needs C<use utf8> currently. [XXX: Why?!? High-bit chars were
-syntax errors when they occurred within identifiers in previous versions,
-so this should probably be enabled by default.]
-
=item *
Regular expressions match characters instead of bytes. For instance,
@@ -109,11 +135,6 @@ Regular expressions match characters instead of bytes. For instance,
is provided to force a match a single byte ("C<char>" in C, hence
C<\C>).)
-Unicode support in regular expressions needs C<use utf8> currently.
-[XXX: Because the SWASH routines need to be loaded. And the RE engine
-appears to need an overhaul to dynamically match Unicode anyway--the
-current RE compiler creates different nodes with and without C<use utf8>.]
-
=item *
Character classes in regular expressions match characters instead of
@@ -121,8 +142,6 @@ bytes, and match against the character properties specified in the
Unicode properties database. So C<\w> can be used to match an ideograph,
for instance.
-C<use utf8> is needed to enable this. See above.
-
=item *
Named Unicode properties and block ranges make be used as character
@@ -133,8 +152,6 @@ any mark character. Single letter properties may omit the brackets, so
that can be written C<\pM> also. Many predefined character classes are
available, such as C<\p{IsMirrored}> and C<\p{InTibetan}>.
-C<use utf8> is needed to enable this. See above.
-
=item *
The special pattern C<\X> match matches any extended Unicode sequence
@@ -143,16 +160,12 @@ character is a base character and subsequent characters are mark
characters that apply to the base character. It is equivalent to
C<(?:\PM\pM*)>.
-C<use utf8> is needed to enable this. See above.
-
=item *
The C<tr///> operator translates characters instead of bytes. It can also
-be forced to translate between 8-bit codes and UTF-8 regardless of the
-surrounding utf8 state. For instance, if you know your input in Latin-1,
-you can say:
+be forced to translate between 8-bit codes and UTF-8. For instance, if you
+know your input in Latin-1, you can say:
- use utf8;
while (<>) {
tr/\0-\xff//CU; # latin1 char to utf8
...
@@ -164,8 +177,6 @@ Similarly you could translate your output with
No, C<s///> doesn't take /U or /C (yet?).
-C<use utf8> is needed to enable this. See above.
-
=item *
Case translation operators use the Unicode case translation tables
diff --git a/pp.sym b/pp.sym
index 03d36a0cbd..73d3dcfba6 100644
--- a/pp.sym
+++ b/pp.sym
@@ -26,6 +26,7 @@ Perl_ck_listiob
Perl_ck_match
Perl_ck_method
Perl_ck_null
+Perl_ck_open
Perl_ck_repeat
Perl_ck_require
Perl_ck_rfun
diff --git a/pp_ctl.c b/pp_ctl.c
index edbe7b19ab..42811f5619 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2727,8 +2727,11 @@ S_doeval(pTHX_ int gimme, OP** startop)
av_store(comppadlist, 1, (SV*)PL_comppad);
CvPADLIST(PL_compcv) = comppadlist;
- if (!saveop || saveop->op_type != OP_REQUIRE)
+ if (!saveop ||
+ (saveop->op_type != OP_REQUIRE && saveop->op_type != OP_DOFILE))
+ {
CvOUTSIDE(PL_compcv) = (CV*)SvREFCNT_inc(caller);
+ }
SAVEFREESV(PL_compcv);
diff --git a/pp_proto.h b/pp_proto.h
index 3fa494ed1f..7f2d80b0b1 100644
--- a/pp_proto.h
+++ b/pp_proto.h
@@ -25,6 +25,7 @@ PERL_CKDEF(Perl_ck_listiob)
PERL_CKDEF(Perl_ck_match)
PERL_CKDEF(Perl_ck_method)
PERL_CKDEF(Perl_ck_null)
+PERL_CKDEF(Perl_ck_open)
PERL_CKDEF(Perl_ck_repeat)
PERL_CKDEF(Perl_ck_require)
PERL_CKDEF(Perl_ck_rfun)
diff --git a/pp_sys.c b/pp_sys.c
index da352a2fab..976f5a13ad 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -304,9 +304,14 @@ PP(pp_backtick)
STRLEN n_a;
char *tmps = POPpx;
I32 gimme = GIMME_V;
+ char *mode = "r";
TAINT_PROPER("``");
- fp = PerlProc_popen(tmps, "r");
+ if (PL_op->op_private & OPpOPEN_IN_RAW)
+ mode = "rb";
+ else if (PL_op->op_private & OPpOPEN_IN_CRLF)
+ mode = "rt";
+ fp = PerlProc_popen(tmps, mode);
if (fp) {
if (gimme == G_VOID) {
char tmpbuf[256];
@@ -687,15 +692,20 @@ PP(pp_binmode)
IO *io;
PerlIO *fp;
MAGIC *mg;
+ SV *discp = Nullsv;
if (MAXARG < 1)
RETPUSHUNDEF;
+ if (MAXARG > 1)
+ discp = POPs;
gv = (GV*)POPs;
if (gv && (mg = SvTIED_mg((SV*)gv, 'q'))) {
PUSHMARK(SP);
XPUSHs(SvTIED_obj((SV*)gv, mg));
+ if (discp)
+ XPUSHs(discp);
PUTBACK;
ENTER;
call_method("BINMODE", G_SCALAR);
@@ -708,13 +718,12 @@ PP(pp_binmode)
if (!(io = GvIO(gv)) || !(fp = IoIFP(io)))
RETPUSHUNDEF;
- if (do_binmode(fp,IoTYPE(io),TRUE))
+ if (do_binmode(fp,IoTYPE(io),mode_from_discipline(discp)))
RETPUSHYES;
else
RETPUSHUNDEF;
}
-
PP(pp_tie)
{
djSP;
@@ -3078,9 +3087,26 @@ PP(pp_fttext)
#else
else if (*s & 128) {
#ifdef USE_LOCALE
- if (!(PL_op->op_private & OPpLOCALE) || !isALPHA_LC(*s))
-#endif
- odd++;
+ if ((PL_op->op_private & OPpLOCALE) && isALPHA_LC(*s))
+ continue;
+#endif
+ /* utf8 characters don't count as odd */
+ if (*s & 0x40) {
+ int ulen = UTF8SKIP(s);
+ if (ulen < len - i) {
+ int j;
+ for (j = 1; j < ulen; j++) {
+ if ((s[j] & 0xc0) != 0x80)
+ goto not_utf8;
+ }
+ --ulen; /* loop does extra increment */
+ s += ulen;
+ i += ulen;
+ continue;
+ }
+ }
+ not_utf8:
+ odd++;
}
else if (*s < 32 &&
*s != '\n' && *s != '\r' && *s != '\b' &&
diff --git a/proto.h b/proto.h
index 83adf587d5..3a58718437 100644
--- a/proto.h
+++ b/proto.h
@@ -129,6 +129,11 @@ PERL_CALLCONV char* Perl_form_nocontext(const char* pat, ...)
__attribute__((format(printf,1,2)))
#endif
;
+PERL_CALLCONV void Perl_load_module_nocontext(U32 flags, SV* name, SV* ver, ...)
+#ifdef CHECK_FORMAT
+ __attribute__((format(printf,3,4)))
+#endif
+;
PERL_CALLCONV SV* Perl_mess_nocontext(const char* pat, ...)
#ifdef CHECK_FORMAT
__attribute__((format(printf,1,2)))
@@ -383,6 +388,12 @@ PERL_CALLCONV void Perl_lex_start(pTHX_ SV* line);
PERL_CALLCONV OP* Perl_linklist(pTHX_ OP* o);
PERL_CALLCONV OP* Perl_list(pTHX_ OP* o);
PERL_CALLCONV OP* Perl_listkids(pTHX_ OP* o);
+PERL_CALLCONV void Perl_load_module(pTHX_ U32 flags, SV* name, SV* ver, ...)
+#ifdef CHECK_FORMAT
+ __attribute__((format(printf,pTHX_3,pTHX_4)))
+#endif
+;
+PERL_CALLCONV void Perl_vload_module(pTHX_ U32 flags, SV* name, SV* ver, va_list* args);
PERL_CALLCONV OP* Perl_localize(pTHX_ OP* arg, I32 lexical);
PERL_CALLCONV I32 Perl_looks_like_number(pTHX_ SV* sv);
PERL_CALLCONV int Perl_magic_clearenv(pTHX_ SV* sv, MAGIC* mg);
@@ -457,6 +468,7 @@ PERL_CALLCONV void Perl_mg_magical(pTHX_ SV* sv);
PERL_CALLCONV int Perl_mg_set(pTHX_ SV* sv);
PERL_CALLCONV I32 Perl_mg_size(pTHX_ SV* sv);
PERL_CALLCONV OP* Perl_mod(pTHX_ OP* o, I32 type);
+PERL_CALLCONV int Perl_mode_from_discipline(pTHX_ SV* discp);
PERL_CALLCONV char* Perl_moreswitches(pTHX_ char* s);
PERL_CALLCONV OP* Perl_my(pTHX_ OP* o);
PERL_CALLCONV NV Perl_my_atof(pTHX_ const char *s);
diff --git a/t/comp/require.t b/t/comp/require.t
index efce899edc..1d92687355 100755
--- a/t/comp/require.t
+++ b/t/comp/require.t
@@ -7,7 +7,7 @@ BEGIN {
# don't make this lexical
$i = 1;
-print "1..19\n";
+print "1..20\n";
sub do_require {
%INC = ();
@@ -113,7 +113,18 @@ do_require "1";
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
-END { 1 while unlink 'bleah.pm'; }
+# do FILE shouldn't see any outside lexicals
+my $x = "ok $i\n";
+write_file("bleah.do", <<EOT);
+\$x = "not ok $i\\n";
+EOT
+do "bleah.do";
+dofile();
+sub dofile { do "bleah.do"; };
+print $x;
+$i++;
+
+END { 1 while unlink 'bleah.pm'; 1 while unlink 'bleah.do'; }
# ***interaction with pod (don't put any thing after here)***
diff --git a/universal.c b/universal.c
index f6b25a4d33..28e08969b4 100644
--- a/universal.c
+++ b/universal.c
@@ -139,6 +139,9 @@ XS(XS_UNIVERSAL_isa)
sv = ST(0);
+ if (SvGMAGICAL(sv))
+ mg_get(sv);
+
if (!SvOK(sv) || !(SvROK(sv) || SvCUR(sv)))
XSRETURN_UNDEF;
@@ -162,6 +165,9 @@ XS(XS_UNIVERSAL_can)
sv = ST(0);
+ if (SvGMAGICAL(sv))
+ mg_get(sv);
+
if (!SvOK(sv) || !(SvROK(sv) || SvCUR(sv)))
XSRETURN_UNDEF;
diff --git a/utf8.c b/utf8.c
index ff113f9fdf..212c55549b 100644
--- a/utf8.c
+++ b/utf8.c
@@ -670,6 +670,13 @@ Perl_swash_init(pTHX_ char* pkg, char* name, SV *listsv, I32 minbits, I32 none)
SV* retval;
char tmpbuf[256];
dSP;
+
+ if (!gv_stashpv(pkg, 0)) { /* demand load utf8 */
+ ENTER;
+ Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpv(pkg,0), Nullsv);
+ LEAVE;
+ }
+ SPAGAIN;
PUSHSTACKi(PERLSI_MAGIC);
PUSHMARK(SP);
EXTEND(SP,5);
diff --git a/vms/vmsish.h b/vms/vmsish.h
index 55401f7f6b..12b13696ce 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -307,7 +307,7 @@
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
diff --git a/vos/vosish.h b/vos/vosish.h
index c5c819a57b..5a6b0796f8 100644
--- a/vos/vosish.h
+++ b/vos/vosish.h
@@ -36,7 +36,7 @@
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
diff --git a/win32/win32.c b/win32/win32.c
index 97b51bab10..840274beab 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3203,10 +3203,20 @@ win32_spawnvp(int mode, const char *cmdname, const char *const *argv)
}
memset(&StartupInfo,0,sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
+ memset(&tbl,0,sizeof(tbl));
PerlEnv_get_child_IO(&tbl);
- StartupInfo.hStdInput = tbl.childStdIn;
- StartupInfo.hStdOutput = tbl.childStdOut;
- StartupInfo.hStdError = tbl.childStdErr;
+ StartupInfo.dwFlags = tbl.dwFlags;
+ StartupInfo.dwX = tbl.dwX;
+ StartupInfo.dwY = tbl.dwY;
+ StartupInfo.dwXSize = tbl.dwXSize;
+ StartupInfo.dwYSize = tbl.dwYSize;
+ StartupInfo.dwXCountChars = tbl.dwXCountChars;
+ StartupInfo.dwYCountChars = tbl.dwYCountChars;
+ StartupInfo.dwFillAttribute = tbl.dwFillAttribute;
+ StartupInfo.wShowWindow = tbl.wShowWindow;
+ StartupInfo.hStdInput = tbl.childStdIn;
+ StartupInfo.hStdOutput = tbl.childStdOut;
+ StartupInfo.hStdError = tbl.childStdErr;
if (StartupInfo.hStdInput != INVALID_HANDLE_VALUE &&
StartupInfo.hStdOutput != INVALID_HANDLE_VALUE &&
StartupInfo.hStdError != INVALID_HANDLE_VALUE)
diff --git a/win32/win32.h b/win32/win32.h
index 1669ea4b29..81bf5747a9 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -302,6 +302,23 @@ typedef struct {
HANDLE childStdIn;
HANDLE childStdOut;
HANDLE childStdErr;
+ /*
+ * the following correspond to the fields of the same name
+ * in the STARTUPINFO structure. Embedders can use these to
+ * control the spawning process' look.
+ * Example - to hide the window of the spawned process:
+ * dwFlags = STARTF_USESHOWWINDOW;
+ * wShowWindow = SW_HIDE;
+ */
+ DWORD dwFlags;
+ DWORD dwX;
+ DWORD dwY;
+ DWORD dwXSize;
+ DWORD dwYSize;
+ DWORD dwXCountChars;
+ DWORD dwYCountChars;
+ DWORD dwFillAttribute;
+ WORD wShowWindow;
} child_IO_table;
DllExport void win32_get_child_IO(child_IO_table* ptr);