[perl.git] branch blead, updated. v5.13.6-572-g8c8488c

2010-11-17 Thread Craig A. Berry
In perl.git, the branch blead has been updated



- Log -
commit 8c8488cd4fce90cb5c03fb3f89e89c05e5275498
Author: Craig A. Berry 
Date:   Wed Nov 17 22:10:57 2010 -0600

Make perlio line buffer VMS record-oriented files on output.

When perlio flushes down to the unix layer, it can introduce a
spurious record boundary when writing to a record-oriented file.
Perl may create such files when doing edit-in-place or any other
context where the file format is inherited from a previous
version of the file.

The problem can be eliminated by enabling line buffering on such
files when they are opened.  This was a regression in 5.10.0 since
before that stdio's buffering performed the same function.

N.B.  Lines longer than the size of the perlio buffer will still
result in multiple records -- a larger buffer may be necessary.

For more details and discussion see:

http://www.nntp.perl.org/group/perl.vmsperl/2010/11/msg15419.html

Thanks to Martin Zinser for the problem report.
---

Summary of changes:
 ext/VMS-Stdio/t/vms_stdio.t |   32 +++-
 perlio.c|   16 
 2 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/ext/VMS-Stdio/t/vms_stdio.t b/ext/VMS-Stdio/t/vms_stdio.t
index 77505d8..64fe3a3 100644
--- a/ext/VMS-Stdio/t/vms_stdio.t
+++ b/ext/VMS-Stdio/t/vms_stdio.t
@@ -2,7 +2,7 @@
 use VMS::Stdio;
 import VMS::Stdio qw(&flush &getname &rewind &sync &tmpnam);
 
-print "1..18\n";
+print "1..19\n";
 print +(defined(&getname) ? '' : 'not '), "ok 1\n";
 
 #VMS can pretend that it is UNIX.
@@ -77,3 +77,33 @@ close $sfh;
 unlink("$name.tmp");
 print +($defs[0] eq uc($ENV{'SYS$LOGIN'}) ? '' : "not ($defs[0]) "),"ok 18\n";
 #print +($defs[1] eq VMS::Filespec::rmsexpand('[-]') ? '' : "not ($defs[1]) 
"),"ok 19\n";
+
+# This is not exactly a test of VMS::Stdio, but we need it to create a 
record-oriented
+# file and then make sure perlio can write to it without introducing spurious 
newlines.
+
+1 while unlink 'rectest.lis';
+END { 1 while unlink 'rectest.lis'; }
+
+$fh = VMS::Stdio::vmsopen('>rectest.lis', 'rfm=var', 'rat=cr')
+   or die "Couldn't open rectest.lis: $!";
+close $fh;
+
+open $fh, '>', 'rectest.lis'
+   or die "Couldn't open rectest.lis: $!";
+
+for (1..20) { print $fh ('Z' x 2048) . "\n" ; }
+
+close $fh;
+
+open $fh, '<', 'rectest.lis'
+   or die "Couldn't open rectest.lis: $!";
+
+my @records = <$fh>;
+close $fh;
+
+if (scalar(@records) == 20) {
+print "ok 19\n";
+}
+else {
+print "not ok 18 # Expected 20 got " . scalar(@records) . "\n";
+}
diff --git a/perlio.c b/perlio.c
index 13b1351..4620ecd 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3761,6 +3761,22 @@ PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t 
*layers,
 */
PerlLIO_setmode(fd, O_BINARY);
 #endif
+#ifdef VMS
+#include 
+   /* Enable line buffering with record-oriented regular files
+* so we don't introduce an extraneous record boundary when
+* the buffer fills up.
+*/
+   if (PerlIOBase(f)->flags & PERLIO_F_CANWRITE) {
+   Stat_t st;
+   if (PerlLIO_fstat(fd, &st) == 0
+   && S_ISREG(st.st_mode)
+   && (st.st_fab_rfm == FAB$C_VAR 
+   || st.st_fab_rfm == FAB$C_VFC)) {
+   PerlIOBase(f)->flags |= PERLIO_F_LINEBUF;
+   }
+   }
+#endif
}
}
 }

--
Perl5 Master Repository


[perl.git] branch dagolden/install-less-unicore, deleted. v5.13.6-571-g393d856

2010-11-17 Thread David Golden
In perl.git, the branch dagolden/install-less-unicore has been deleted



   was  393d85601c5e417b218dca2ff14369c4eaf16267

---
393d85601c5e417b218dca2ff14369c4eaf16267 Don't install unnecessary unicore files
---

--
Perl5 Master Repository


[perl.git] branch dagolden/install-stripped, created. v5.13.6-573-g51d89f9

2010-11-17 Thread David Golden
In perl.git, the branch dagolden/install-stripped has been created



at  51d89f984561aa19554062ac2be972cc5ba1ba87 (commit)

- Log -
commit 51d89f984561aa19554062ac2be972cc5ba1ba87
Author: David Golden 
Date:   Wed Nov 17 19:20:10 2010 -0500

Add install-stripped target to Makefile.SH

install-stripped will omit man pages, omit pod/* and strip Pod
from all .pm, .pl and .pod files.  It results in a significantly
smaller final installation, though obviously without
documentation.  It also strips debugging symbols from binaries.

On my system, using './Configure -des -Dusedevel', the install
directory is 61M with 'make install' but only 32M with
'make install-stripped'.  When compressed as .tgz files,
the results are 15M and 7.3M respectively.

M   Makefile.SH
M   installperl

commit b1e3be1192cc6b78283918d022c8725595be115f
Author: David Golden 
Date:   Wed Nov 17 16:54:19 2010 -0500

Add support for stripping Pod during installation

Adds an installperl option '-P' to strip Pod from
all .pm, .pl and .pod files during installation.

M   install_lib.pl
M   installperl
---

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.13.6-571-ge4ed29f

2010-11-17 Thread David Golden
In perl.git, the branch blead has been updated



- Log -
commit e4ed29fbb903ac6b15b0ec4a5a6696aaa73401f2
Author: David Golden 
Date:   Wed Nov 17 15:03:18 2010 -0500

Don't install unnecessary unicore files

Many of the files in lib/unicore are no longer needed
after testing.  This patches installperl to skip those
files, cutting down the installed size of unicore
from about 17M to about 7M.
---

Summary of changes:
 installperl |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/installperl b/installperl
index c6d358b..d1eafe6 100755
--- a/installperl
+++ b/installperl
@@ -716,6 +716,19 @@ sub installlib {
 return if $name =~ m{\b(?:APItest|Typemap)\.pm$};
 # ignore the demo files
 return if $dir =~ /\b(?:demos?|eg)\b/;
+# ignore unneeded unicore files
+if ( $dir =~ /^unicore/ ) {
+  if ( $name =~ /\.txt\z/ ) {
+# We can ignore most, but not all .txt files
+return unless $name =~ 
/\A(?:UnicodeData|Blocks|Scripts|CompositionExclusions|CaseFolding|SpecialCasing|NamedSequences)\.txt\z/;
+  }
+  else {
+# TestProp only needed during testing
+return if $name =~ /\ATestProp.pl\z/;
+# we need version and *.pl files and can skip the rest
+return unless $name =~ /\A(?:version|\w+\.pl)\z/;
+  }
+}
 
 # ignore READMEs, MANIFESTs, INSTALL docs, META.ymls and change logs.
 # Changes.e2x and README.e2x are needed by enc2xs.

--
Perl5 Master Repository


[perl.git] branch dagolden/install-less-unicore, created. v5.13.6-571-g393d856

2010-11-17 Thread David Golden
In perl.git, the branch dagolden/install-less-unicore has been created



at  393d85601c5e417b218dca2ff14369c4eaf16267 (commit)

- Log -
commit 393d85601c5e417b218dca2ff14369c4eaf16267
Author: David Golden 
Date:   Wed Nov 17 15:03:18 2010 -0500

Don't install unnecessary unicore files

Many of the files in lib/unicore are no longer needed
after testing.  This patches installperl to skip those
files, cutting down the installed size of unicore
from about 17M to about 7M.
---

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.13.6-570-gaa2f79c

2010-11-17 Thread Nicholas Clark
In perl.git, the branch blead has been updated



- Log -
commit aa2f79cfd781fa0bd9e0fcec607dd31150743daa
Author: Nicholas Clark 
Date:   Wed Nov 17 11:39:06 2010 +

In Perl_cv_undef(), only check potential pads against PL_comppad

Don't even try checking the address of the pad name AV against PL_comppad, 
and
don't try checking the address of pad AVs against PL_comppad_name. Neither 
will
ever match.

M   pad.c

commit 61c5492ade04e0e4885f062e63c9f5d91f769541
Author: Nicholas Clark 
Date:   Wed Nov 17 10:58:46 2010 +

In S_pad_check_dup(), no need to check the 0th name entry.

The 0th entry in a pad is for @_, and the name corresponding to it is NULL,
so save a check.

M   pad.c
---

Summary of changes:
 pad.c |   17 +++--
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/pad.c b/pad.c
index 2c1c81d..7d7b5eb 100644
--- a/pad.c
+++ b/pad.c
@@ -363,16 +363,20 @@ Perl_cv_undef(pTHX_ CV *cv)
}
 
ix = AvFILLp(padlist);
-   while (ix >= 0) {
+   while (ix > 0) {
SV* const sv = AvARRAY(padlist)[ix--];
if (sv) {
-   if (sv == (const SV *)PL_comppad_name)
-   PL_comppad_name = NULL;
-   else if (sv == (const SV *)PL_comppad) {
+   if (sv == (const SV *)PL_comppad) {
PL_comppad = NULL;
PL_curpad = NULL;
}
+   SvREFCNT_dec(sv);
}
+   }
+   {
+   SV *const sv = AvARRAY(padlist)[0];
+   if (sv == (const SV *)PL_comppad_name)
+   PL_comppad_name = NULL;
SvREFCNT_dec(sv);
}
SvREFCNT_dec(MUTABLE_SV(CvPADLIST(cv)));
@@ -662,7 +666,7 @@ S_pad_check_dup(pTHX_ SV *name, const U32 flags, const HV 
*ourstash)
 }
 /* check the rest of the pad */
 if (is_our) {
-   do {
+   while (off > 0) {
SV * const sv = svp[off];
if (sv
&& sv != &PL_sv_undef
@@ -678,7 +682,8 @@ S_pad_check_dup(pTHX_ SV *name, const U32 flags, const HV 
*ourstash)
"\t(Did you mean \"local\" instead of \"our\"?)\n");
break;
}
-   } while ( off-- > 0 );
+   --off;
+   }
 }
 }
 

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.13.6-568-g7bff8c3

2010-11-17 Thread Nicholas Clark
In perl.git, the branch blead has been updated



- Log -
commit 7bff8c334b79055a65ea37cb51de6d9629880b6c
Author: Nicholas Clark 
Date:   Wed Nov 17 08:34:52 2010 +

Convert newSUB() to a macro wrapping Perl_newATTRSUB()

Provide a Perl_newSUB() function in mathoms.c for anyone referencing it by 
its
full name.
---

Summary of changes:
 embed.fnc |3 ++-
 embed.h   |1 -
 mathoms.c |7 +++
 op.c  |6 --
 op.h  |2 ++
 proto.h   |2 +-
 6 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/embed.fnc b/embed.fnc
index a51f148..1d89b96 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -794,7 +794,8 @@ Ap  |void   |newPROG|NN OP* o
 Apda   |OP*|newRANGE   |I32 flags|NN OP* left|NN OP* right
 Apda   |OP*|newSLICEOP |I32 flags|NULLOK OP* subscript|NULLOK OP* 
listop
 Apda   |OP*|newSTATEOP |I32 flags|NULLOK char* label|NULLOK OP* o
-Ap |CV*|newSUB |I32 floor|NULLOK OP* o|NULLOK OP* proto|NULLOK 
OP* block
+Abm|CV*|newSUB |I32 floor|NULLOK OP* o|NULLOK OP* proto \
+   |NULLOK OP* block
 ApM|CV *   |newXS_flags|NULLOK const char *name|NN XSUBADDR_t subaddr\
|NN const char *const filename \
|NULLOK const char *const proto|U32 flags
diff --git a/embed.h b/embed.h
index 279683b..42515df 100644
--- a/embed.h
+++ b/embed.h
@@ -334,7 +334,6 @@
 #define newRV_noinc(a) Perl_newRV_noinc(aTHX_ a)
 #define newSLICEOP(a,b,c)  Perl_newSLICEOP(aTHX_ a,b,c)
 #define newSTATEOP(a,b,c)  Perl_newSTATEOP(aTHX_ a,b,c)
-#define newSUB(a,b,c,d)Perl_newSUB(aTHX_ a,b,c,d)
 #define newSV(a)   Perl_newSV(aTHX_ a)
 #define newSVOP(a,b,c) Perl_newSVOP(aTHX_ a,b,c)
 #define newSVREF(a)Perl_newSVREF(aTHX_ a)
diff --git a/mathoms.c b/mathoms.c
index dac7eae..32f3215 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -83,6 +83,7 @@ PERL_CALLCONV I32 Perl_my_lstat(pTHX);
 PERL_CALLCONV I32 Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2);
 PERL_CALLCONV char * Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp);
 PERL_CALLCONV bool Perl_sv_2bool(pTHX_ register SV *const sv);
+PERL_CALLCONV CV * Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block);
 
 /* ref() is now a macro using Perl_doref;
  * this version provided for binary compatibility only.
@@ -1582,6 +1583,12 @@ Perl_custom_op_desc(pTHX_ const OP* o)
 PERL_ARGS_ASSERT_CUSTOM_OP_DESC;
 return XopENTRY(Perl_custom_op_xop(aTHX_ o), xop_desc);
 }
+
+CV *
+Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block)
+{
+return Perl_newATTRSUB(aTHX_ floor, o, proto, NULL, block);
+}
 #endif /* NO_MATHOMS */
 
 /*
diff --git a/op.c b/op.c
index 98adf8c..2e974fd 100644
--- a/op.c
+++ b/op.c
@@ -6056,12 +6056,6 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP 
*attrs, OP *block)
 }
 
 CV *
-Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block)
-{
-return Perl_newATTRSUB(aTHX_ floor, o, proto, NULL, block);
-}
-
-CV *
 Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
 {
 dVAR;
diff --git a/op.h b/op.h
index 9a5ec94..c011d66 100644
--- a/op.h
+++ b/op.h
@@ -852,6 +852,8 @@ one of the OA_* constants from op.h.
 ? XopENTRY(Perl_custom_op_xop(aTHX_ o), xop_class) \
 : (PL_opargs[(o)->op_type] & OA_CLASS_MASK))
 
+#define newSUB(f, o, p, b) Perl_newATTRSUB(aTHX_ (f), (o), (p), NULL, (b))
+
 #ifdef PERL_MAD
 #  define MAD_NULL 1
 #  define MAD_PV 2
diff --git a/proto.h b/proto.h
index 069c5eb..6679e59 100644
--- a/proto.h
+++ b/proto.h
@@ -2548,7 +2548,7 @@ PERL_CALLCONV OP* Perl_newSTATEOP(pTHX_ I32 flags, char* 
label, OP* o)
__attribute__malloc__
__attribute__warn_unused_result__;
 
-PERL_CALLCONV CV*  Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* 
block);
+/* PERL_CALLCONV CV*   Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* 
block); */
 PERL_CALLCONV SV*  Perl_newSV(pTHX_ const STRLEN len)
__attribute__malloc__
__attribute__warn_unused_result__;

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.13.6-567-gd90d5a3

2010-11-17 Thread Rafael Garcia-Suarez
In perl.git, the branch blead has been updated



- Log -
commit d90d5a3845e854b868ede5476fd329d1fb85fd46
Author: Rafael Garcia-Suarez 
Date:   Wed Nov 17 09:28:30 2010 +0100

Spelling/grammar nits
---

Summary of changes:
 pod/perlop.pod |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pod/perlop.pod b/pod/perlop.pod
index aaa86de..c577f36 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -510,7 +510,7 @@ Although it has no direct equivalent in C, Perl's C 
operator is related
 to its C-style or.  In fact, it's exactly the same as C<||>, except that it
 tests the left hand side's definedness instead of its truth.  Thus, C<$a // $b>
 is similar to C (except that it returns the value of C<$a>
-rather than the value of C) and yields the same result than
+rather than the value of C) and yields the same result as
 C (except that the ternary-operator form can be
 used as a lvalue, while C<$a // $b> cannot).  This is very useful for
 providing default values for variables.  If you actually want to test if
@@ -1142,7 +1142,7 @@ example, see L.)  Starting 
in Perl 5.14, you may
 use C<\o{}> instead which avoids all these problems.  Otherwise, it is best to
 use this construct only for ordinals C<\077> and below, remembering to pad to
 the left with zeros to make three digits.  For larger ordinals, either use
-C<\o{}> , or convert to someething else, such as to hex and use C<\x{}>
+C<\o{}> , or convert to something else, such as to hex and use C<\x{}>
 instead.
 
 Having fewer than 3 digits may lead to a misleading warning message that says

--
Perl5 Master Repository