This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 years agoMerge branch 'perlopentut' into blead
Ricardo Signes [Wed, 24 Jul 2013 04:34:36 +0000 (21:34 -0700)]
Merge branch 'perlopentut' into blead

10 years agoperlopentut: standardize on no newline in die
Ricardo Signes [Wed, 24 Jul 2013 04:25:07 +0000 (21:25 -0700)]
perlopentut: standardize on no newline in die

it is nice to know from where an error originates!

10 years agoperlopentut: Spelling and stylistic improvements only.
James E Keenan [Fri, 12 Jul 2013 15:35:42 +0000 (17:35 +0200)]
perlopentut: Spelling and stylistic improvements only.

10 years agoperlopentut: add copyright/author, remove history
Ricardo Signes [Fri, 12 Jul 2013 14:55:59 +0000 (10:55 -0400)]
perlopentut: add copyright/author, remove history

10 years agoperlopentut: correct perlfaq links
Ricardo Signes [Fri, 12 Jul 2013 14:42:06 +0000 (10:42 -0400)]
perlopentut: correct perlfaq links

thanks to David Golden for pointing this out

10 years agoDon't patch perlopentut: rewrite it completely
Tom Christiansen [Fri, 12 Jul 2013 14:20:36 +0000 (10:20 -0400)]
Don't patch perlopentut: rewrite it completely

Patch made by rjbs, from <10107.1361064602@chthon>

> Nearly [all of perlopentut] is non-simple. That is not a tutorial,
> and it is not just about open.  It is more like "FMTEYEWTK About
> open() and I/O in Perl". If the goal is to create a document that
> teaches people how to use open() for the simple cases, then there
> is no hope for perlopentut.  It cannot be turned into that,
> because that is not what it is.  You have to start over.

10 years agoRevert "Remove the non-inline function S_croak_memory_wrap from inline.h."
Tony Cook [Tue, 23 Jul 2013 01:36:01 +0000 (11:36 +1000)]
Revert "Remove the non-inline function S_croak_memory_wrap from inline.h."

This reverts commit 43387ee1abcd83c3c7586b7f7aa86e838d239aac.

Which reverted parts of f019c49e380f764c1ead36fe3602184804292711, but that
reversion may no longer be necessary.

See [perl #116989]

10 years agoFor changelogs suggest name it Changes and follow CPAN::Changes::Spec
Neil Bowers [Sun, 21 Jul 2013 19:59:20 +0000 (20:59 +0100)]
For changelogs suggest name it Changes and follow CPAN::Changes::Spec

10 years agoRevert "perl5180delta: typo"
Father Chrysostomos [Wed, 24 Jul 2013 01:01:35 +0000 (18:01 -0700)]
Revert "perl5180delta: typo"

This reverts commit cbd5ead563d5a5df04e771f407468c0d3bcdb9f7.

Tony Cook pointed out in
<20130724003722.GA12260@mars.tony.develop-help.com> that I have no
idea what I am talking about.

(I did mean gigabyte.)

10 years agopos.t: test something I almost broke
Father Chrysostomos [Tue, 23 Jul 2013 21:38:30 +0000 (14:38 -0700)]
pos.t: test something I almost broke

10 years agofix typo in sv.c apidocs
Father Chrysostomos [Tue, 23 Jul 2013 21:37:29 +0000 (14:37 -0700)]
fix typo in sv.c apidocs

sv_pos_u2b_flags has no offsetp parameter.  This was copied from
sv_pos_u2b.

10 years agosv.c: Remove overflow check in utf8 length cache
Father Chrysostomos [Sun, 21 Jul 2013 13:56:07 +0000 (06:56 -0700)]
sv.c: Remove overflow check in utf8 length cache

In order to make large values of pos() possible, the previous commit
enlarged the mg_len field of the magic struct.  That field is also
used for cached utf8 length values.  Since it is now large enough to
store any length the OS/compiler supports, the overflow never happens.

10 years ago[perl #72766] Allow huge pos() settings
Father Chrysostomos [Sun, 21 Jul 2013 07:38:28 +0000 (00:38 -0700)]
[perl #72766] Allow huge pos() settings

This is part of #116907, too.  It also fixes #72924 as a side effect;
the next commit will explain.

The value of pos($foo) was being stored as an I32, not allowing values
above I32_MAX.  Change it to SSize_t (the signed equivalent of size_t,
representing the maximum string length the OS/compiler supports).

This is accomplished by changing the size of the entry in the magic
struct, which is the simplest fix.

Other parts of the code base can benefit from this, too.

We actually cast the pos value to STRLEN (size_t) when reading
it, to allow *very* long strings.  Only the value -1 is special,
meaning there is no pos.  So the maximum supported offset is
2**sizeof(size_t)-2.

The regexp engine itself still cannot handle large strings, so being
able to set pos to large values is useless right now.  This is but one
piece in a larger puzzle.

Changing the size of mg->mg_len also requires that
Perl_hv_placeholders_p change its type.  This function
should in fact not be in the API, since it exists
solely to implement the HvPLACEHOLDERS macro.  See
<https://rt.perl.org/rt3/Ticket/Display.html?id=116907#txn-1237043>.

10 years agoAdd sv_pos_b2u_flags
Father Chrysostomos [Sun, 21 Jul 2013 07:30:20 +0000 (00:30 -0700)]
Add sv_pos_b2u_flags

This, similar to sv_pos_u2b_flags, is a more friendly variant of
sv_pos_u2b that works with 2GB strings and actually returns a
value instead of modifying a passed-in value in place through
a pointer.

The next commit will use this.

10 years agoperl5180delta: typo
Father Chrysostomos [Sun, 21 Jul 2013 02:02:13 +0000 (19:02 -0700)]
perl5180delta: typo

10 years ago_invlist_intersection() didn't work for NULL first param
Karl Williamson [Tue, 23 Jul 2013 16:40:07 +0000 (10:40 -0600)]
_invlist_intersection() didn't work for NULL first param

It is supposed to accept a NULL first parameter (one of the operands to
the intersection).  This adds a special case for it.

10 years agosv.c: Remove duplicate dups
Karl Williamson [Tue, 23 Jul 2013 15:42:25 +0000 (09:42 -0600)]
sv.c: Remove duplicate dups

These dupes of two tinterpreter variables were already done a few lines
above; also move a third, related, dupe to where the others are done.

10 years agoRemove useless assignments
Karl Williamson [Sun, 21 Jul 2013 16:49:05 +0000 (10:49 -0600)]
Remove useless assignments

These aren't used after setting.  They came from blindly copying code to
this.

10 years agoregcomp.c: Fix #define
Karl Williamson [Sat, 20 Jul 2013 19:21:14 +0000 (13:21 -0600)]
regcomp.c: Fix #define

cl_init_zero should not be defined as S_cl_init, just 'cl_init'.  The S_
prefix is wrong should cl_init be changed to have a pTHX_.

10 years agoregcomp.c: Remove wrong/obsolete line
Karl Williamson [Sat, 20 Jul 2013 19:16:55 +0000 (13:16 -0600)]
regcomp.c: Remove wrong/obsolete line

This line was made obsolete and wrong by commit
a0316a6cd4a14261beb22d95530d5763e8b6756b, which changed the format of
inversion lists.  This hasn't caused problems because the code currently
is #ifdef'd out.

10 years agoregcomp.c: Add some asserts()
Karl Williamson [Tue, 23 Jul 2013 15:25:36 +0000 (09:25 -0600)]
regcomp.c: Add some asserts()

Now that inversion lists are their own scalar types, we can verify that
the parameters to their manipulation functions are indeed inversion
lists.  This adds such assertions to the bottom level code that deals
with the bare metal of the scalars.  Functions that call these (even if
only in other asserts) didn't have asserts added to them, as they call
these anyway.

10 years agoMerge the install_lib.pl/installman/installperl refactoring into blead.
Nicholas Clark [Tue, 23 Jul 2013 12:36:03 +0000 (14:36 +0200)]
Merge the install_lib.pl/installman/installperl refactoring into blead.

10 years agoinstall_lib.pl's samepath() should not warn if $p1 does not exist.
Nicholas Clark [Sun, 14 Jul 2013 09:44:20 +0000 (11:44 +0200)]
install_lib.pl's samepath() should not warn if $p1 does not exist.

If $p1 is a non-existent path, then the two paths can't be the same, so
samepath() should promptly return false.

10 years agoIn install_lib.pl, no need to Config->import for the relocatableinc setup.
Nicholas Clark [Sun, 14 Jul 2013 09:12:17 +0000 (11:12 +0200)]
In install_lib.pl, no need to Config->import for the relocatableinc setup.

require Config; within the BEGIN block instead of using it outside it to
save creating one implicit BEGIN block, and running its import twice.

Remove the require 5.004; as the require of Config will fail if running
with anything other than the version about to be installed.

Note in installperl and installman that install_lib.pl imports Config.

10 years agoMove the wrapper for File::Path::mkpath() to install_lib.pl
Nicholas Clark [Sat, 13 Jul 2013 18:50:44 +0000 (20:50 +0200)]
Move the wrapper for File::Path::mkpath() to install_lib.pl

installperl and installman call File::Path::mkpath with identical arguments
and options, so move the repeated code into a single place.

10 years agoMove {safe_,}rename() from install{man,perl} into install_lib.pl
Nicholas Clark [Sat, 13 Jul 2013 16:33:53 +0000 (18:33 +0200)]
Move {safe_,}rename() from install{man,perl} into install_lib.pl

installman's rename() was identical to installperl's safe_rename() in all
but name (and whitespace), so de-duplicate by moving the code to
install_lib.pl

10 years ago[perl #74798] fix the build for -Duseithreads
Tony Cook [Tue, 23 Jul 2013 01:48:54 +0000 (11:48 +1000)]
[perl #74798] fix the build for -Duseithreads

10 years agoFix missing single quote in a sed in hints/aix.sh
Peter Martini [Sun, 21 Jul 2013 22:45:45 +0000 (18:45 -0400)]
Fix missing single quote in a sed in hints/aix.sh

10 years agoepigraphs.pod: Fix too long verbatim lines
Karl Williamson [Tue, 23 Jul 2013 00:01:30 +0000 (18:01 -0600)]
epigraphs.pod: Fix too long verbatim lines

The new 5.19.2 epigraph is prose, so it can just be block-quoted
instead of verbatim.

This commit also fixes the 5.13.11 epigraph, which already had some long
lines wrapped.

10 years agoperldelta for 1d5bb6ba43b89
Tony Cook [Tue, 23 Jul 2013 00:38:57 +0000 (10:38 +1000)]
perldelta for 1d5bb6ba43b89

10 years ago[perl #116190] -F implies -a, either implies -n
Tony Cook [Tue, 23 Jul 2013 00:24:45 +0000 (10:24 +1000)]
[perl #116190] -F implies -a, either implies -n

Previously -F without -a was a no-op, and -a without -n or -p was a
no-op, with this change, if you supply -F then both -a and -n are
implied (you can still use -p for its extra behaviour), and if you
supply -a then -n is implied.

10 years ago[perl #116190] feed an empty stdin to run_multiple_progs() programs
Tony Cook [Tue, 16 Jul 2013 04:57:20 +0000 (14:57 +1000)]
[perl #116190] feed an empty stdin to run_multiple_progs() programs

Two tests for -a were attempting to read stdin and blocking with the -a
implies -n change.

10 years ago[perl #116190] -F and -a now imply -n
Tony Cook [Tue, 16 Jul 2013 02:11:55 +0000 (12:11 +1000)]
[perl #116190] -F and -a now imply -n

10 years ago[perl #116190] use the true and trusted fresh_perl_is()
Tony Cook [Tue, 16 Jul 2013 02:00:41 +0000 (12:00 +1000)]
[perl #116190] use the true and trusted fresh_perl_is()

instead of re-inventing it yet again

10 years agoMake the -F switch imply -a
Aristotle Pagaltzis [Wed, 9 Jan 2013 10:26:56 +0000 (11:26 +0100)]
Make the -F switch imply -a

10 years agoperldelta for 059639d5cdd
Tony Cook [Mon, 22 Jul 2013 23:52:29 +0000 (09:52 +1000)]
perldelta for 059639d5cdd

10 years agobump version for Data-Dumper
Tony Cook [Mon, 22 Jul 2013 23:46:55 +0000 (09:46 +1000)]
bump version for Data-Dumper

I had a stray 5.19.2 tag (possibly from testing a few weeks back) that
allowed cmp_version.t to pass

10 years ago[perl #74798] improved useqq compatibility with the pure perl version
Tony Cook [Mon, 22 Jul 2013 23:18:41 +0000 (09:18 +1000)]
[perl #74798] improved useqq compatibility with the pure perl version

Currently for non-useqq, the pure perl and XS output for numbers like
these is different, but XS useqq is new, so try to remain vaguely
compatible.

10 years agoAvoid read-after-free in S_scan_heredoc() if the terminator line has no "\n".
Nicholas Clark [Thu, 27 Jun 2013 16:09:32 +0000 (18:09 +0200)]
Avoid read-after-free in S_scan_heredoc() if the terminator line has no "\n".

The code added by commit 112d128413206514 to fix RT #65838 (Allow here-doc
with no final newline) could in some rare cases cause a read of free()d
memory during parsing. The code itself is only run if the Perl program
ends with a heredoc (which is an unusual structure), and if the last line of
the file on disk has no terminating newline character (which is also unusual,
as many editors default to adding a final newline). The bug would be
triggered if the fixup code in S_scan_heredoc() triggered a reallocation of
the buffer in PL_linestr when adding a newline to it.

10 years agoModule-CoreList is 2.94 on CPAN now
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 10:55:23 +0000 (11:55 +0100)]
Module-CoreList is 2.94 on CPAN now

10 years agoUpdate Module-Build to CPAN version 4.007
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 08:41:01 +0000 (09:41 +0100)]
Update Module-Build to CPAN version 4.007

  [DELTA]

0.4007 - Fri Jul 19 13:44:39 CEST 2013

  [BUG FIXES]

  - Removed undeclared test dependency on parent.pm [Leon Timmermans]

  - Declared dependency on Pod::Man 2.17 for utf8 support [Leon Timmermans]

  - Force generation of man pages in manify_with_utf8.t [Leon Timmermans]

0.4006 - Thu Jul 18 14:19:49 CEST 2013

  [ENHANCEMENTS]

  - Significantly sped up some tests by not forcing HTML docs to be
    built when the user's config doesn't ask for them anyway.
    [Ken Williams]

  - The Module::Metadata package was split out from this distro back
    in 2010.  Removed its regression tests. [Ken Williams]

  - Removed dependence on IO::File, replacing it with safe invocations
    of open(). [Sven Dowideit]

  - Added an 'extra_manify_args' parameter to facilitate man pages
    containing Unicode. [Joenio Costa]

  - Added an '--html_links 0' argument for the 'html' action, which
    can hugely speed things up.  The main effect is speeding up the
    M::B tests themselves. [Ken Williams]

  [BUG FIXES]

  - Fix hash argument parsing in subclasses [Graham Ollis]

  - Revised detildification on VMS [Craig Berry]

  - Fix run_test_harness for case when $Switches is an empty string
    [Victor Efimov, Ken Williams]

10 years agoUpdate IPC-SysV to CPAN version 2.04
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 08:28:39 +0000 (09:28 +0100)]
Update IPC-SysV to CPAN version 2.04

  [DELTA]

  2.04 - 2013-07-20

    * CPAN #72458: Add 'all' export
      (thanks to Milan Kocian for providing a patch)
    * CPAN #79821: Install to 'site' for perl 5.11+
      (thanks to Robert Sedlacek for providing a patch)
    * CPAN #86736: Fix spelling of IPC_CREAT
    * CPAN #78882: Document SIZE parameter of IPC::SharedMem->new()
    * CPAN #78927: Fix spelling of 'nattch'

10 years agoMerge the work which improves test diagnostics from run_multiple_progs().
Nicholas Clark [Mon, 22 Jul 2013 08:09:50 +0000 (10:09 +0200)]
Merge the work which improves test diagnostics from run_multiple_progs().

10 years agoReport useful file names and line numbers from run_multiple_progs().
Nicholas Clark [Mon, 15 Jul 2013 09:27:22 +0000 (11:27 +0200)]
Report useful file names and line numbers from run_multiple_progs().

Previously if tests in run_multiple_progs() failed the report gave the file
name and line number of the ok() call in run_multiple_progs(). Now, where
possible, report the file and line of the actual test program. If this
information isn't available, report the error at the file and line which
called run_multiple_progs().

This will improve error reporting from lib/charnames.t, lib/feature.t,
lib/strict.t, lib/subs.t, lib/warnings.t and t/lib/croak.t

10 years agoRemove a duplicate test separator "########\n" line from the pp_sys tests.
Nicholas Clark [Mon, 15 Jul 2013 09:13:48 +0000 (11:13 +0200)]
Remove a duplicate test separator "########\n" line from the pp_sys tests.

The existing parser using split includes the second "########\n" as part of
the extracted test program, which the Perl interpreter treats as a comment
line. The parser refactoring in the next commit no longer adds the line to
the extracted test program, causing the line numbers for the warnings to
differ by one.

The extra "########\n" was added as part of commit c521cf7c8af1697e in Dec
2010, along with the test program which follows it, and the (now) incorrect
line number expectations.

10 years agoMerge the file parsing code for run_multiple_progs() into _setup_one_file().
Nicholas Clark [Sun, 14 Jul 2013 18:44:50 +0000 (20:44 +0200)]
Merge the file parsing code for run_multiple_progs() into _setup_one_file().

setup_multiple_progs() calls _setup_one_file() to parse each file in turn,
and run_multiple_progs() calls it once if passed a file handle.

10 years agoMove file parsing code from t/lib/common.pl to t/test.pl
Nicholas Clark [Sun, 14 Jul 2013 16:58:58 +0000 (18:58 +0200)]
Move file parsing code from t/lib/common.pl to t/test.pl

Move the code that prepares input to run_multiple_progs() by parsing files
into a subroutine setup_multiple_progs(). This will enable the parsing code
in run_multiple_progs() to be merged, and the combined code to be altered to
give improved diagnostics on test failure.

10 years agoRefactor the setup code in t/lib/common.pl
Nicholas Clark [Sun, 14 Jul 2013 15:29:59 +0000 (17:29 +0200)]
Refactor the setup code in t/lib/common.pl

Eliminate the variable $line which has never been used.
(The code was added by commit bd4dea8e97f4a8f5 in June 2001.)
Use a non-capturing group in a regex.
Check the return value of close and die if there is an error.
Explicitly count the tests found.
Avoid indirect object syntax for a method call.

10 years agolib/warnings.t should actually run the test in t/lib/warnings/doop
Nicholas Clark [Mon, 15 Jul 2013 07:48:02 +0000 (09:48 +0200)]
lib/warnings.t should actually run the test in t/lib/warnings/doop

The file containing a single test for a warning in doop.c was added by
commit 0453d815b8a74697 in June 1999. However, as the file does not contain
an __END__ marker, the parser skips the entire contents of the file looking
for the __END__, and then assumes that the file contains no tests. This has
been true since the parser code was first implemented (in t/pragma/warning.t)
in commit 8ebc5c0145d2e355 in Jan 1997.

The simplest fix is to add an __END__ to the start of t/lib/warnings/doop
Also add some sanity checking to ensure that this doesn't happen again.

10 years agosimplify README.macosx instructions
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:38:58 +0000 (09:38 +0200)]
simplify README.macosx instructions

This also removes a repeating version bumping bug.

10 years agofix my stupid perlhist typo
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:28:12 +0000 (09:28 +0200)]
fix my stupid perlhist typo

10 years agostub CoreList for v5.19.3
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:07:37 +0000 (09:07 +0200)]
stub CoreList for v5.19.3

10 years agobump version to v5.19.3
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:05:44 +0000 (09:05 +0200)]
bump version to v5.19.3

10 years agocreate fresh perldelta
Aristotle Pagaltzis [Mon, 22 Jul 2013 06:39:56 +0000 (08:39 +0200)]
create fresh perldelta

10 years agoadd v5.19.2 epigraph
Aristotle Pagaltzis [Mon, 22 Jul 2013 06:33:12 +0000 (08:33 +0200)]
add v5.19.2 epigraph

10 years agoupdate perlhist for v5.19.2 release v5.19.2
Aristotle Pagaltzis [Mon, 22 Jul 2013 04:09:31 +0000 (06:09 +0200)]
update perlhist for v5.19.2 release

10 years agoupdate perldelta for v5.19.2 release
Aristotle Pagaltzis [Mon, 22 Jul 2013 04:09:04 +0000 (06:09 +0200)]
update perldelta for v5.19.2 release

10 years agoupdate Module::CoreList for v5.19.2 release
Aristotle Pagaltzis [Mon, 22 Jul 2013 02:45:01 +0000 (04:45 +0200)]
update Module::CoreList for v5.19.2 release

10 years agoUpdate Socket to CPAN version 2.010
Aristotle Pagaltzis [Sun, 21 Jul 2013 04:43:47 +0000 (06:43 +0200)]
Update Socket to CPAN version 2.010

[DELTA]

2013/06/24
2.010   CHANGES:
         * Wrap some IPTOS_* constants, which may come from <netinet/ip.h>
         * Probe for and optionally include <netinet/ip.h>
         * Defeat C compilers' attempts to optimise away configure-time probes
           for functions that are never called

10 years agoClarify av_shift API docs
Steffen Mueller [Sat, 20 Jul 2013 15:53:08 +0000 (17:53 +0200)]
Clarify av_shift API docs

10 years agoperldelta: #118931 is a known issue
Father Chrysostomos [Sat, 20 Jul 2013 00:58:06 +0000 (17:58 -0700)]
perldelta: #118931 is a known issue

10 years agoBenchmark.t: remove CPU-speed-sensitive test
David Mitchell [Fri, 19 Jul 2013 22:10:50 +0000 (23:10 +0100)]
Benchmark.t: remove CPU-speed-sensitive test

Benchmark.t has been randomly failing test 15 in smokes for ages.
This is the one that checks that a loop run 3*N times burns approximately
3 times more CPU than when run just N times.

For the last month the test has included a calibration loop and test,
which does much the same thing, but without using any code from
Benchmark.pm. This has failed just as much, which confirms that its an
issue with the smoke host (such as a variable speed CPU or whatever),
rather than any flaw in the Benchmark.pm library logic.

So just remove the calibration loop and the dodgy test.

10 years agomore op_folded support: B, dump
Reini Urban [Thu, 18 Jul 2013 19:50:35 +0000 (14:50 -0500)]
more op_folded support: B, dump

also add more B::OP accessors for the missing bitfields

10 years agoAdd Niels Thykier to AUTHORS
Father Chrysostomos [Fri, 19 Jul 2013 01:51:54 +0000 (18:51 -0700)]
Add Niels Thykier to AUTHORS

10 years agoop.c: Add op_folded to BASEOP
Niels Thykier [Wed, 17 Jul 2013 18:59:54 +0000 (20:59 +0200)]
op.c: Add op_folded to BASEOP

Add a new member, op_folded, to BASEOP.  It is replacement for
OPpCONST_FOLDED (which can only be set on OP_CONST).  At the moment
OPpCONST_FOLDED remains, as it is exposed in B (e.g. B::Concise relies
on it).

Signed-off-by: Niels Thykier <niels@thykier.net>
10 years agotoke.c:yylex: assert that PL_linestr is not a COW
Father Chrysostomos [Wed, 17 Jul 2013 06:29:25 +0000 (23:29 -0700)]
toke.c:yylex: assert that PL_linestr is not a COW

and fix the one bug this uncovers.

With COW enabled all the time, it is easy to introduce bugs like this.
See also 4e917a04.  In short, toke.c expects to be able to modify
PL_linestr’s buffer.  Putting this assertion in yylex (a hot path)
will make sure PL_linestr never becomes a COW again.

10 years agosv.c: Assert that sv_[ivp]v are not passed aggregates
Father Chrysostomos [Fri, 19 Jul 2013 15:51:47 +0000 (08:51 -0700)]
sv.c: Assert that sv_[ivp]v are not passed aggregates

The lack of assertions can hide bugs.  See 32a609747bffb for instance

10 years agolocale.c: Add missing STATIC to fcn decl
Karl Williamson [Fri, 19 Jul 2013 15:50:27 +0000 (09:50 -0600)]
locale.c: Add missing STATIC to fcn decl

10 years agoMove some tests from cpan/version to t/run
Karl Williamson [Wed, 17 Jul 2013 04:02:46 +0000 (22:02 -0600)]
Move some tests from cpan/version to t/run

Commit fb7942811c8097ed2e61fd35a90345226546176a recently moved
version.pm to cpan.  Earlier, in commit
b127e37e51c21b0a36755dcd19811be931a03d83, I had added tests to version's
.t that arguably belonged elsewhere.  I did this because I thought that
this .t was the only one around that had the infrastructure already
written to allow such tests to easily be added, and it was in /lib so
p5p controlled it.  (That infrastructure being finding locales with the
decimal point not a dot.)  Since then, I found that t/run/locale.t has
similar infrastructure.  Given that version now may end up being cpan
upstream, I thought it best to move those tests to t/run/locale.t

I notice that changes to this .t prior to these no longer were careful
to avoid 'use locale' in case the platform doesn't support it, and there
have been no field problems; so I just went ahead and did a 'use locale'
too.

10 years agocpan/version/t/07locale.t: Actually test what is claimed
Karl Williamson [Wed, 17 Jul 2013 04:05:57 +0000 (22:05 -0600)]
cpan/version/t/07locale.t: Actually test what is claimed

Commit b127e37e51c21b0a36755dcd19811be931a03d83 wrongly changed two
tests, and failed to change a third.  One of the two ended up doing:
        ok ("$ver eq '1,23'", ...);
That's always going to succeed as ok() doesn't do an eval; it just looks
at the result of the expression, which in this case was a non-empty
string.

The second test was changed from an 'eq' to '=='.  It had this diff:

 -       is ($v, "1.23", "Locale doesn't apply to version objects");
 +       ok ($v == "1.23", "Locale doesn't apply to version objects");

(The code for is() does an 'eq'.)  The is() call is made from within the
scope of a "use locale" in which the decimal point character is a comma,
but version objects are supposed to always use a dot, regardless of the
locale.  The == will numify the operands, potentially throwing away the
locale's decimal point character.  Therefore the test should use an
'eq'.

Before these changes, the two tests also didn't do what they purported
(and hence the motivation for the changes).  The tests previously used
'is()', which is defined in a different file which is outside the locale
scope, so that the scalars ($v and $ver) there should have a dot even
if they have a comma within locale scope, and hence doing an is() would
not catch the bug being tested against.  Hence the third test
(overlooked in the earlier commit) remained wrong until now.

10 years agosv.h: Comments added/typo fixed.
Karl Williamson [Wed, 17 Jul 2013 04:01:08 +0000 (22:01 -0600)]
sv.h: Comments added/typo fixed.

10 years agoperldelta: minor grammar fixes
Ricardo Signes [Fri, 19 Jul 2013 14:58:23 +0000 (10:58 -0400)]
perldelta: minor grammar fixes

10 years agoremove some instruction bloat in S_find_uninit_var
Daniel Dragan [Sat, 22 Dec 2012 14:34:40 +0000 (09:34 -0500)]
remove some instruction bloat in S_find_uninit_var

VC 2003 -O1 put down SvIV(cSVOPx_sv(kid)) twice in asm. Not sure why.

Explicitly store the values to make it more obvious to the compiler to
evaluate the SvIV only once, then do the branch, not do the negate branch,
then in a negate branch do a SvIV. Result is less machine code read by the
CPU. The .text section dropped 0xC01FF to 0xC018F after this change.

10 years agohandle multiple children exiting in perlipc example
Tony Cook [Fri, 12 Jul 2013 07:12:46 +0000 (17:12 +1000)]
handle multiple children exiting in perlipc example

10 years agopod2html output concerns
Tony Cook [Thu, 11 Jul 2013 07:03:44 +0000 (17:03 +1000)]
pod2html output concerns

10 years agoRemove 5.005 thread support from configure.com.
Craig A. Berry [Thu, 18 Jul 2013 20:19:51 +0000 (15:19 -0500)]
Remove 5.005 thread support from configure.com.

Follow-up to 5ff367e3adebb49.

10 years agoUpdate Parse-CPAN-Meta to CPAN version 1.4405
Chris 'BinGOs' Williams [Thu, 18 Jul 2013 11:30:07 +0000 (12:30 +0100)]
Update Parse-CPAN-Meta to CPAN version 1.4405

  [DELTA]

  1.4405    2013-07-17 21:43:34 America/New_York
      - Fixed incorrect "return ... or die ..." constructs
      - Converted distribution to Dist::Zilla management
      - Noted new repository location in the Github Perl-Toolchain-Gang
        organization

10 years agobisect.pl now accepts repeated -e options, just like perl.
Nicholas Clark [Wed, 17 Jul 2013 10:23:42 +0000 (12:23 +0200)]
bisect.pl now accepts repeated -e options, just like perl.

10 years agoperldelta for =>
Father Chrysostomos [Wed, 17 Jul 2013 06:06:53 +0000 (23:06 -0700)]
perldelta for =>

10 years agoAllow => to quote built-in keywords across lines
Father Chrysostomos [Sat, 13 Jul 2013 06:37:26 +0000 (23:37 -0700)]
Allow => to quote built-in keywords across lines

This is the second try.  5969c5766a5d3 had a bug in it under non-
MAD builds.

If I have a sub I can use its name as a bareword as long as I suffix
it with =>, even if the => is on the next line:

$ ./perl -Ilib -e 'sub tim; warn tim' -e '=>'
tim at -e line 1.

If I want to use a built-in keyword’s name as a bareword, I can put =>
after it:

$ ./perl -Ilib -e 'warn time =>'
time at -e line 1.

But if I combine the two (keyword + newline), it does not work:

$ ./perl -Ilib -e 'warn time' -e ' =>'
1373611283 at -e line 1.

unless I override the keyword:

$ ./perl -Ilib -Msubs=time -e 'warn time' -e ' =>'
time at -e line 1.

=> after a bareword is checked for in two places in toke.c.  The first
comes before a comment saying ‘NO SKIPSPACE BEFORE HERE!’; it only
skips spaces and finds a => on the same line.  The second comes later;
it skips vertical space and comments, too.

But the second check is in a code path that is not reached by keywords
that are not overridden (as is the ‘NO SKIPSPACE’ comment).

This commit adds an extra check for built-in keywords after we have
determined that the keyword is not overridden.  In that case, there is
no reason we cannot use skipspace, as we no longer have to worry about
what PL_oldbufptr etc. point to.

This commit leaves __DATA__ and __END__ alone, since they
are special, problematic and controversial.  (See, e.g.,
<https://rt.perl.org/rt3/Ticket/Display.html?id=78348#txn-1234355>.)

Allowing whitespace to be scanned across line boundaries without
increasing the line number (something this commit has to do to make
this work) can cause the way PL_linestr is handled to change.

PL_linestr usually holds just the current line when reading from a
handle.  Now it can hold the current line plus the next line or seve-
ral lines, depending on how much whitespace is to be found there.

When '\n' or '#' was encountered, the lexer would modify the buffer in
place and add a null, setting PL_bufend to point to that null.  That
would make it look as though the end of the line had been reached, and
avoided having to scan to find the end of a comment.

In string eval and quote-like operators, the end of the comment does
have to be scanned for.  We can’t just fake EOL and read the next
line of input.

Under MAD builds, the end of the comment was being scanned for any-
way, even when reading from a handle.  So everything worked under MAD,
which was what I tested 5969c5766a5d3 under.

This commit changes the '\n' and '#' handling to match the MAD code
(scan for the end of the comment instead of faking a buffer trunca-
tion), which 5969c5766a5d3 failed to do.

10 years agoignore the build product lib/version.pod
Tony Cook [Wed, 17 Jul 2013 01:14:30 +0000 (11:14 +1000)]
ignore the build product lib/version.pod

fb7942811 moved version from lib/ to cpan/ and added most of the needed
lib/.gitignore entries, missing only this one.

10 years ago[perl #74798] useqq implementation for xs
Tony Cook [Wed, 17 Jul 2013 01:09:21 +0000 (11:09 +1000)]
[perl #74798] useqq implementation for xs

10 years agohandle xs Useqq dumping of strings with an escape followed by a digit
Tony Cook [Wed, 10 Jul 2013 04:54:20 +0000 (14:54 +1000)]
handle xs Useqq dumping of strings with an escape followed by a digit

The original patch didn't handle a string like "\x001" correctly, encoding
it as "\01" rather than "\0001".

Added tests for this case and some possible corner cases

10 years agoadjust indentation to match other DD code
Tony Cook [Wed, 10 Jul 2013 04:19:17 +0000 (14:19 +1000)]
adjust indentation to match other DD code

10 years agoData::Dumper: useqq implementation for xs
Slaven Rezic [Wed, 10 Jul 2013 04:18:18 +0000 (14:18 +1000)]
Data::Dumper: useqq implementation for xs

Tests are mainly unchanged, just a "cheat" and a couple of TODOs were
removed.

10 years agoMerge branch 'const_posix_invlists' into blead
Karl Williamson [Tue, 16 Jul 2013 19:59:03 +0000 (13:59 -0600)]
Merge branch 'const_posix_invlists' into blead

This is the second attempt to put this functionality into blead.  The
first was in commit dab1d6f279e5792c6a935eeaeeec652a883df979.  Its
elements had to be backed out because it turns out there were array
bounds errors.  This new commit should have fixed those.  The revised
commit message is:

What characters certain POSIX classes match, like [[:xdigit:]] are
compiled into a C header file, thus avoiding the necessity of reading
them in from disk at run-time.  This merge makes those fully const, so
that they can get loaded as part of a read-only text segment.  The sv's
that contain these are set so that SvLEN is 0; this means that copies
are not made when they are dup'd, such as when threads are created.

A new svtype is created for inversion lists, using the single available
slot, renumbering them.  The first few commits instead use an existing
svtype, repurposing some of its fields for use by inversion lists.  This
was done so that this could be done in a maintenance release, if
necessary.  (Their not being fully const can interfere with
-DPERL_GLOBAL_STRUCT_PRIVATE.)  And also, should it become necessary to
create an svtype for some other purpose, we can revert to that point in
the branch

10 years agoRemove redundant field from inversion lists
Karl Williamson [Fri, 12 Jul 2013 21:11:26 +0000 (15:11 -0600)]
Remove redundant field from inversion lists

The number of elements in an inversion list is a simple calculation
based on SvCUR().  Prior to this patch there was a field that contained
that number directly, and the two values diverged, causing a bug.  A
single value can't get out-of-sync with itself.

10 years agoAdd parameter to internal function
Karl Williamson [Fri, 12 Jul 2013 20:07:49 +0000 (14:07 -0600)]
Add parameter to internal function

The function invlist_set_len() has to be called after the offset header
field in an inversion list has been set.  To make sure that future
maintainers don't forget to do this, add the parameter for the 'offset'
to its call, so it can't be called without having this value.

10 years agoregcomp.c: Rmv now redundant setting
Karl Williamson [Fri, 12 Jul 2013 17:30:16 +0000 (11:30 -0600)]
regcomp.c: Rmv now redundant setting

SvCUR is now properly set in invlist_set_len().  There is no need to do
it outside that function.

10 years agoFix off-by-one error in inversion lists.
Karl Williamson [Fri, 12 Jul 2013 03:56:46 +0000 (21:56 -0600)]
Fix off-by-one error in inversion lists.

The first commit of this topic branch added a dummy 0 element to the end
of certain inversion lists to work around an off-by-one error.  This
commit makes the necessary changes to stop that error, and to remove
the dummy element.  SvCUR() and invlist_len() now are kept in sync.

10 years agoregcomp.c: Reorder a couple of function calls
Karl Williamson [Fri, 12 Jul 2013 01:44:56 +0000 (19:44 -0600)]
regcomp.c: Reorder a couple of function calls

A future commit with require that the offset be known before the length
gets set.  This prepares for that.

10 years agoregcomp.c: Remove now useless initialization
Karl Williamson [Fri, 12 Jul 2013 01:38:53 +0000 (19:38 -0600)]
regcomp.c: Remove now useless initialization

This code was designed to cause a segfault by initializing an offset
into an address to a very large value.  But now, it is stored as a bool,
so there is not point in doing this.  We also remove an assert that it
is a bool, because it always has to be.

10 years agoregcomp.c: Only White-space, comments, name of variable change
Karl Williamson [Fri, 12 Jul 2013 01:16:55 +0000 (19:16 -0600)]
regcomp.c: Only White-space, comments, name of variable change

10 years agoReinstate "Use new Svt_INVLIST for inversion lists."
Karl Williamson [Sat, 6 Jul 2013 21:33:57 +0000 (15:33 -0600)]
Reinstate "Use new Svt_INVLIST for inversion lists."

This reverts commit 2e0b8fbeab3502bee36f25825c3cdd0d075c4fd3, which
reverted e0ce103ae532f9576f54a5938a24d1ee98dfb928, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This converts inversion lists to use their own scalar type.

10 years agoReinstate "Create SVt_INVLIST"
Karl Williamson [Sat, 6 Jul 2013 21:29:11 +0000 (15:29 -0600)]
Reinstate "Create SVt_INVLIST"

This reverts commit 49cf1d6641a6dfd301302f616e4f25595dcc65d4, which
reverted e045dbedc7da04e20cc8cfccec8a2e3ccc62cc8b, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This reshuffles the svtype enum to remove the dummy slot created in a
previous commit, and add the new SVt_INVLIST type in its proper order.
It still is unused, but since it is an extension of SVt_PV, it must be
greater than that type's enum value.  Since it can't be upgraded to any
other PV type, it comes right after SVt_PV.

 Affected tables in the core are updated.

10 years agoReinstate "regcomp.c: Move some #defines to only file that uses them"
Karl Williamson [Sat, 6 Jul 2013 21:10:14 +0000 (15:10 -0600)]
Reinstate "regcomp.c: Move some #defines to only file that uses them"

This reverts commit 247f9b19318882fd9a52fe49aa31fc8d3d3db4f7, which
reverted 05944450e0fc82eb8fc1fb5a4bf63f23785262a0, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

These were used in a header file to provide synchronization between
files.  However, the only other file that would need them is a .pl file
which doesn't have access to them.  So simplify things so that the
variables are either removed entirely if only used in a single place, or
are #defined in the area where they are used

10 years agoReinstate "regcomp.c: Make C-array inversion lists const"
Karl Williamson [Sat, 6 Jul 2013 20:56:39 +0000 (14:56 -0600)]
Reinstate "regcomp.c: Make C-array inversion lists const"

This reverts commit 18505f093a44607b687ae5fe644872f835f66313, which
reverted 241136e0ed70738cccd6c4b20ce12b26231f30e5, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

The inversion lists that are compiled into a C header are now const.

10 years agoReinstate "regcomp.c: Move inversion list hdr field to SV hdr"
Karl Williamson [Sat, 6 Jul 2013 20:44:32 +0000 (14:44 -0600)]
Reinstate "regcomp.c: Move inversion list hdr field to SV hdr"

This reverts commit 2eb2feb9f4a226d0fe0fd3d66e2ce341296f0072, which
reverted d913fb457b732da4c31d0d1b8c085989a7ecd12d, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This moves the final field that can vary from the inversion list data
structure into the header of the SV that contains it.  With this commit,
the body of an inversion list is now const.

The field is converted to a U8, to correspond with the header field in
the SV type that we currently use to hold inversion lists.

10 years agoReinstate "regcomp.c: Change, variable, fcn name"
Karl Williamson [Sat, 6 Jul 2013 20:29:35 +0000 (14:29 -0600)]
Reinstate "regcomp.c: Change, variable, fcn name"

This reverts commit 0b58015e05b2ab93b080b7c49a70bf82435363c0, which
reverted 875c4e2c5193b5245da578b222e9c93aad31d93b, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was (slightly revised for clarity):

These have always been slightly misnamed, but a recent commit made them
more so.  The old name contained "zero", but now there is a new element
which always has zero.  The renamed element indicates whether the
inversion list is offset, that is if the beginning is the zero element,
or if the beginning is the next element beyond the zero element.

10 years agoReinstate "regcomp.c: Move 2 hdr inversion fields to SV hdr"
Karl Williamson [Sat, 6 Jul 2013 20:13:35 +0000 (14:13 -0600)]
Reinstate "regcomp.c: Move 2 hdr inversion fields to SV hdr"

This reverts commit 67434bafe4f2406e7c92e69013aecd446c896a9a, which
reverted 4fdeca7844470c929f35857f49078db1fd124dbc, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This commit continues the process of separating the header area of
inversion lists from the body.  2 more fields are moved out of the
header portion of the inversion list, and into the header portion of the
SV that contains it.